fabiodias
24-05-2010 21:35:52
Olá pessoal!!
tenho uma dúvida quanto a um codigo que peguei para abrir arquivo de excel.. porém mudei o codigo para abrir tambem em PDF na planilha:
Private Sub CommandButton1_Click()
x = GetDirectory
ligne = Dir(x & "\" & "*.*")
Do While ligne <> ""
DoEvents
ligne = Dir()
ListBox1.AddItem ligne
Loop
End Sub
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
If mbDisableEvents Then Exit Sub
mbDisableEvents = True
With Me.ListBox1
If .ListCount > 0 Then
If .ListIndex = .ListCount - 1 Then
.ListIndex = .ListCount - 1
End If
End If
'MsgBox "Vous avez sélectionné :" & .List(.ListIndex)
End With
mbDisableEvents = False
End Sub
Private Sub CommandButton2_Click()
'pour ouvrir le classeur sélectionné
nom = x & "\" & ListBox1
Workbooks.Open Filename:=(nom)
End Sub
porem ta dando erro no codigo que esta em negrito.
alguem sabe informar o porque desse erro?
desde ja agradeço!!
tenho uma dúvida quanto a um codigo que peguei para abrir arquivo de excel.. porém mudei o codigo para abrir tambem em PDF na planilha:
Private Sub CommandButton1_Click()
x = GetDirectory
ligne = Dir(x & "\" & "*.*")
Do While ligne <> ""
DoEvents
ligne = Dir()
ListBox1.AddItem ligne
Loop
End Sub
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
If mbDisableEvents Then Exit Sub
mbDisableEvents = True
With Me.ListBox1
If .ListCount > 0 Then
If .ListIndex = .ListCount - 1 Then
.ListIndex = .ListCount - 1
End If
End If
'MsgBox "Vous avez sélectionné :" & .List(.ListIndex)
End With
mbDisableEvents = False
End Sub
Private Sub CommandButton2_Click()
'pour ouvrir le classeur sélectionné
nom = x & "\" & ListBox1
Workbooks.Open Filename:=(nom)
End Sub
porem ta dando erro no codigo que esta em negrito.
alguem sabe informar o porque desse erro?
desde ja agradeço!!