Re: "Can anyone give suggestions?"
If you made the reference to the MS scripting runtime then your declarations would look like this...
| Dim objFSO As Scripting.FileSystemObject | |
|---|---|
| Dim objFolder As Scripting.Folder | |
| Dim objFile As Scripting.File |
[EDIT-added]
| Set objFSO = New Scripting.FileSystemObject |
|---|
| Set objFolder = objFSO.GetFolder(strPath) |
You don't need to use CreateObject.
'---
Nothing Left to Lose
https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU
(free excel programs)