Motore
2007-07-16 15:23:37 UTC
Con la subroutine sotto riportata mi da errore alla riga seguente:
elenco1.RowSource = Left(elenco1l.RowSource,
Len(elenco1.RowSource) - 1)
mi da errore run time 5
chiamata di routine o argomenti non validi.
e in corrispondenza della riga MyName = Dir(MyPath)
trovo sempre MyName = ""
La subroutine é:
Public Function FillListFiles(ctl As Object, Startpath As string)
Dim MyPath As String
Dim MyName As String
MyPath = "C:\DMI\"
elenco1 .RowSource = ""
MyPath = Startpath
MyName = Dir(MyPath)
Do While MyName <> ""
With elenco1
.RowSource = .RowSource & MyName & ";"
End With
MyName = Dir
Loop
elenco1.RowSource = Left(elenco1l.RowSource,
Len(elenco1.RowSource) - 1)
End Function
Ho selezionato in Strumenti di VBA ---->Riferimenti :
- Visual Basic for appication
- Microsofot 11.0 Object librery
- Microsoft DAO 3.6
- OLE Automation
Grazie
elenco1.RowSource = Left(elenco1l.RowSource,
Len(elenco1.RowSource) - 1)
mi da errore run time 5
chiamata di routine o argomenti non validi.
e in corrispondenza della riga MyName = Dir(MyPath)
trovo sempre MyName = ""
La subroutine é:
Public Function FillListFiles(ctl As Object, Startpath As string)
Dim MyPath As String
Dim MyName As String
MyPath = "C:\DMI\"
elenco1 .RowSource = ""
MyPath = Startpath
MyName = Dir(MyPath)
Do While MyName <> ""
With elenco1
.RowSource = .RowSource & MyName & ";"
End With
MyName = Dir
Loop
elenco1.RowSource = Left(elenco1l.RowSource,
Len(elenco1.RowSource) - 1)
End Function
Ho selezionato in Strumenti di VBA ---->Riferimenti :
- Visual Basic for appication
- Microsofot 11.0 Object librery
- Microsoft DAO 3.6
- OLE Automation
Grazie