Method: GetFile for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: GetFile for FileSystemObject
Method: GetFile for FileSystemObject
Returns a file object that is associated with a path.
Set oFile = Object.GetFile(FilePath)
| Object | FileSystemObject Object with this method |
| FilePath | String Specifies the path of the file. |
| oFile | File Returned object |
The following example returns a file object:
Function GetFileObject(sFile) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Set GetFileObject = fso.GetFile(sFile) End Function