abrir y cerrar archivos
Publicado por Gustavo (181 intervenciones) el 01/02/2005 21:29:01
dos dudas
q verificar i hay una palicacion de excel abierta
y debo cerrarla como se hace
y lo siguiente es un codigo para abrir un archivo
pero cuando doy click en a:\ o en d:\ me dice a l aunidad no esta lista
aunque tenga e disquette adentro
solo funciona con C:\
Private Sub File1_Click()
ruta = Dir1.Path & "\" & File1.FileName
Command1.Enabled = True
End Sub
Private Sub Form_Load()
logo.Picture = LoadResPicture("LOGO", vbResBitmap)
Me.Icon = LoadResPicture(101, vbResIcon)
Command1.Enabled = True
End Sub
Private Sub Command1_Click()
Form3.Show
Unload Me
End Sub
Private Sub Command2_Click()
Form1.Show
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo Solucion
Dir1.Path = Drive1.Drive
Solucion:
Err.Clear
Drive1.Drive = "c:"
MsgBox "La unidad no esta lista", vbOKOnly + vbExclamation, "Error"
End Sub
q verificar i hay una palicacion de excel abierta
y debo cerrarla como se hace
y lo siguiente es un codigo para abrir un archivo
pero cuando doy click en a:\ o en d:\ me dice a l aunidad no esta lista
aunque tenga e disquette adentro
solo funciona con C:\
Private Sub File1_Click()
ruta = Dir1.Path & "\" & File1.FileName
Command1.Enabled = True
End Sub
Private Sub Form_Load()
logo.Picture = LoadResPicture("LOGO", vbResBitmap)
Me.Icon = LoadResPicture(101, vbResIcon)
Command1.Enabled = True
End Sub
Private Sub Command1_Click()
Form3.Show
Unload Me
End Sub
Private Sub Command2_Click()
Form1.Show
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo Solucion
Dir1.Path = Drive1.Drive
Solucion:
Err.Clear
Drive1.Drive = "c:"
MsgBox "La unidad no esta lista", vbOKOnly + vbExclamation, "Error"
End Sub
Valora esta pregunta


0