The code below is showing a compile error "user-defined type not defined" in the line Dim fso...
Can someone tell me what's wrong ?
Can someone tell me what's wrong ?
Code:
Sub test()
Dim fso As FileSystemObject
Dim f As File
Set fso = CreateObject("Scripting.FileSystemObject")
For Each f In fso.GetFolder("C:\temp").Files
MsgBox f.Name
Next
Set fso = Nothing
End Sub