ADIGA88
Member
- Local time
- Today, 08:45
- Joined
- Apr 5, 2020
- Messages
- 93
I am trying to instantiate a folder object to list the files inside a specified folder through GetFolder Menod of "Scripting.FileSystemObject" object, and it's returning a string instead of a Folder object!
Attached:
1. a screenshot of the code and its debugging output.
2. a screenshot of the MS Access doc page for Scripting.FileSystemObject object.
The link to MS Access doc:
The Code I am running that shoud retrun a Folder object:
Attached:
1. a screenshot of the code and its debugging output.
2. a screenshot of the MS Access doc page for Scripting.FileSystemObject object.
The link to MS Access doc:

The Code I am running that shoud retrun a Folder object:
Code:
Option Compare Database
Option Explicit
Dim fs As Object ' File system object
Dim f As Object ' Folder Object
Dim s As Object ' For later user
Sub ShowFolderInfo()
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(fs.GetAbsolutePathName("C:\Dell"))
Debug.Print "VarType fs is " & VarType(fs)
Debug.Print "VarType f is " & VarType(f)
Set fs = Nothing
Set f = Nothing
's = f.DateCreated
'MsgBox s
End Sub