tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
This code works in early binding:
To change to late binding, how do I declare MyFolder?
For example:
Thanks
Code:
Dim fso As Scripting.FileSysemObject
Set fso = New Scripting.FileSystemObject
Dim MyFolder As Folder
Set MyFolder = fso.GetFolder("C:\MyData")
Dim Num As Integer
Num = MyFolder.Files.Count
To change to late binding, how do I declare MyFolder?
For example:
Code:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim MyFolder As Folder ' FAILS HERE
Thanks