Stop searching. Start learning and developing your excel skills.
Macro
VBA
Formula
Function
Shortcut
Tricks

» » VBA Function To Check If File is Exists

VBA Function To Check If File is Exists

June 03, 2017 |
This is also related to below queries:
  1. vba check if file exists in folder
  2. vba if file exists then delete
  3. check if file exists vb
  4. fileexists vba
  5. excel vba check if file is open
The Code:
If Dir("Directory") <> "" Then
Where:

Directory = complete path of the file

Note:
  1. Normally, we are using this to check if the same file name already existed or not before saving or replacing the file
  2. This is just to be cautious 
  3. Next action is depending on your requirement. You could copy, open, delete, or replace the file

No comments:

Post a Comment