Last active
August 29, 2019 10:23
-
-
Save bigarabuza/3f17ae6f9482b2268cb85219d27a2939 to your computer and use it in GitHub Desktop.
Working with FileSystemObject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'create instance of FileSystemObject (Early binding: enables intellisense) | |
Dim objFSO As New FileSystemObject | |
'create instance of FileSystemObject (Late binding: mitigates issue of user referencing library) | |
Dim objFSO as Object | |
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
'create new folder | |
objFSO.CreateFolder("C:\Users\bennyboo9\Documents\Test") | |
'get folder | |
objFSO.GetFolder(""C:\Users\bennyboo9\Documents\Test") | |
'check if folder exists | |
if objFSO.FolderExists("C:\Users\bennyboo9\Documents\Test") | |
Then MsgBox "Folder Exists." | |
Else | |
MsgBox "Folder does not exist." | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment