A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Bob and other Mac experts
I came up with this applescript that I call from VBA, I add it to this page
http://www.rondebruin.nl/mac.htm#exists
Or call AppleScript with VBA, no problems with the max of 27 file name characters.
It is slower but it is working correct as far as I know.
Sub CeckIfFileExistsOnMac()
'Call AppleScript to test if file exists, this example have no problem
'with long file names like the other examples(max of 27 characters)
Dim Filestr As String
Dim scriptToRun As String
Dim Result As Boolean
Filestr = "Ron:Users:rondebruin:Documents:yourshortorlongfilenamehere.xlsm"
scriptToRun = scriptToRun & "tell application " & Chr(34) & "Finder" & Chr(34) & Chr(13)
scriptToRun = scriptToRun & "exists file " & Chr(34) & Filestr & Chr(34) & Chr(13)
scriptToRun = scriptToRun & "end tell" & Chr(13)
Result = MacScript(scriptToRun)
MsgBox Result
End Sub
Is this correct or not, I am new to this stuff so please tell me