Category: File Handling Functions

Ready-made VBA functions for handling files in your VBA projects

Browse for a Folder

BrowseFolder(StartFolder, WindowTitle) As String
Utilise Windows dialog forms to browse for a folder. Set the starting folder (optional) and the windows title (optional) and the browsed for folder will be returned as a string. Or a blank sting will be returned if a valid folder is not chosen.

Check a Folder Exists

DoesFolderExist(FolderPath) As Boolean
Before processing the documents of a folder, check it exists first. You can also pass it the path to a file and it will confirm the folder it is in exists.

Browse for a File

BrowseFile(StartFolder, FileType, WindowTitle) As String
Utilise Windows dialog forms to browse for a file. Set the starting folder (optional), file type (optional) and the windows title (optional). The browsed for file will be returned as a string. Or a blank sting will be returned if a valid file is not chosen.

Check a File Exists

DoesFileExist(FilePath) As Boolean
Before processing the contents of a file, check it exists first. It can be used to check any file and any file type and will return a boolean value.