Created
December 9, 2015 14:51
-
-
Save xenophy/4d9ca3747cb0710629b4 to your computer and use it in GitHub Desktop.
FileExists in Excel for mac 2016 VBA
This file contains hidden or 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
Function FileExists(ByVal AFileName As String) As Boolean | |
On Error GoTo Catch | |
strFile = Dir(AFileName, MacID("TEXT")) | |
FileExists = True | |
GoTo Finally | |
Catch: | |
FileExists = False | |
Finally: | |
End Function |
This file contains hidden or 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
If FileExists("Macintosh HD:Library") Then | |
MsgBox "File exists" | |
Else | |
MsgBox "File doesn't exists" | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment