Skip to content

Instantly share code, notes, and snippets.

@xenophy
Created December 9, 2015 14:51
Show Gist options
  • Save xenophy/4d9ca3747cb0710629b4 to your computer and use it in GitHub Desktop.
Save xenophy/4d9ca3747cb0710629b4 to your computer and use it in GitHub Desktop.
FileExists in Excel for mac 2016 VBA
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
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