Visual Basic - Agregar valores a un Combo

Life is soft - evento anual de software empresarial
 
Vista:

Agregar valores a un Combo

Publicado por ALFONSO (4 intervenciones) el 10/12/2007 21:26:52
Mi problema es que necesito guardar en un fichero. txt nombres en columna (cosa que no hace) y luego al pulsar en el boton de leer que estos nombres se agregen el el Combo yo lo hago asi y no me funciona:

Private Sub GUARDAR_Click()
ruta = ("C:Documents and SettingsusuarioEscritorioprueba.txt")
Set fs = CreateObject("Scripting.FilesystemObject")
Set a = fs.opentextfile(ruta, 8, 1, 0)
a.Close
m = FreeFile
Open ruta For Output As #m
Print #m, Combo1
Close #m
End Sub


Private Function existe(ByVal unfichero As String) As Boolean
On Local Error Resume Next
existe = Len(Dir$(unfichero))
If arr Then
existe = False
End If
arr = 0
On Local Error GoTo 0
End Function


Private Sub LEER_Click()
ruta1 = ("C:Documents and SettingsusuarioEscritorioprueba.txt")
If existe(ruta1) Then
' leer el contenido del fichero
m = FreeFile
Open ruta1 For Input As #1
linea = Input(LOF(1), #1)
Combo1 =linea & vbCr
Close #1
Else
MsgBox " EL FICHERO NO EXISTE", vbCritical, "ERROR"
End If
End Sub


GRACIAS SI PUEDES AYUDA
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder