The below VBA function uses the Dir VBA function to validate Folder Path.
'This function checks if given folder path is valid or not
Public Function CheckFolderExist(strFolderPath As String) As Boolean
'If Dir retunrs blank then it is invalid folder path
If Dir(strFolderPath, vbDirectory) = "" Then
CheckFolderExist = False
MsgBox "Invalid Folder Path!", vbCritical
'Else it is a valid folder path
Else
CheckFolderExist = True
MsgBox "Valid Folder Path!", vbInformation
End If
End Function
Explanation:Â If the function returns True then it is a valid folder path. If function returns False then it is invalid folder path.
Below VBA function uses File System Object to validate Folder path
'This function checks if given folder path is valid or not
'Microsoft Scripting Runtime reference is required to run this code
Public Function CheckFolderExist(strFolderPath As String) As Boolean
Dim objFileSystem As FileSystemObject
Set objFileSystem = New FileSystemObject
'If FolderExists function returns True then it is valid folder path
If objFileSystem.FolderExists(strFolderPath) = True Then
CheckFolderExist = True
MsgBox "Valid Folder Path!", vbInformation
'Else it is invalid folder path
Else
CheckFolderExist = False
MsgBox "Invalid Folder Path!", vbCritical
End If
End Function
Explanation:Â If the function returns True then it is a valid folder path. If function returns False then it is invalid folder path.
Time Management is very effective way of managing the available time. Current competitive world is making the time management crucial. There are various ways, tools and techniques by which time management can be done easily.
Merge Excel Files From last few months, we have been receiving frequent requests from users for a VBA tool which can consolidate Excel files from a folder. So here we come with one more free…
Colorindex in Excel VBA Today let’s try to understand how ColorIndex property in Excel VBA works. It is an easy and effective way to quickly complete the development. ColorIndex property is normally used by VBA…
In MS Access, the best way to create a multiuser tool is to divide your solution. One part acts as interface and other one acts as database. You can have multiple copies of the interface distributed to users which are connected to central MS Access database saved at common shared drive. To connect the interface to database, you can use link table feature (Access>External Data>Import & Link) available in MS Access. Below is a commonly required VBA code which helps the developers to re-link MS Access linked tables when the database is renamed or moved to other location
Time and Motion Tracker is an MS Excel based tool which helps you to track Start and End time of any type of transaction or activity. The tool is developed using VBA coding which helps you to protect manual manipulation in the data by the user. It is also easy to use, just click on Start (shortcut: Ctrl+W) or Stop (Ctrl+E) buttons to record the time stamp. This is professional version of our famous Time & Motion Tracker. This version includes features such as Hold Timer, Consolidation, Utilization Analysis, Dashboards etc.
Dummy Data Generator is an MS Excel based tool which has capability of generating 45 types of data which includes numbers, text, date, time, Memo (long text), Boolean etc.