Stai attento, le variabili le devi dichiarare completamente (ex dim fso as filesystemobject)
string è una parola riservata, non puoi usarla come nome di variabile
detto questo prova questa:
codice:
Private Sub popCombo()
Dim fso As FileSystemObject
Dim folder As folder
Dim file As file
Dim str As String, dirName As String
Dim i As Integer
dirName = "g:\documenti"
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(dirName)
With Me.CasellaCombinata0
.RowSourceType = "value list"
i = 0
For Each file In folder.Files
.AddItem Item:=file.Name, Index:=i
i = i + 1
Next
End With
Set folder = Nothing
Set fso = Nothing
End Sub