How to get file mod date in Excel 2011 from Mac script embedded in vba

Hi! All new to me. Never wrote a Mac script. On Mac OS X 10.6.8, Apple script 2.1.2, and Excel 2011 14.0.0 for Mac. Did not find an answer on Ron DeBruin automation site dedicated to Excel (Win & Mac).


Dim strDefaultSearchPath  As String
Dim strScrOpenFilesOutput As String
Dim strFileDateTime As String
Dim macscriptGetFilenamesToOpen As String
Dim macscriptGetFiledatetimeOfModification  As String

… some other VBA code

’ From Ron DeBruin
macscriptGetFilenamesToOpen = _
“set applescript’s text item delimiters to “”,”" " & vbNewLine & _
“set theFiles to (choose file of type " & _
" {”“”“,”“”“,”“public.comma-separated-values-text”“} " & _
“with prompt ““Choisir une seule liste CSV”” default location alias “”” & _
strDefaultSearchPath & “”” multiple selections allowed false) as string" & vbNewLine & _
“set applescript’s text item delimiters to “””" " & vbNewLine & _
“return theFiles”

’ My unfortunate guess, because “FileDateTime()” works on Win/Excel, but not on Mac/Excel
macscriptGetFiledatetimeOfModification = _
"set theFileFullPath to (((strScrOpenFilesOutput) as text) & ““speed.txt””) " & vbNewLine & _
"tell application ““Sytem Events”” to set theModDate to modification date of file theFileFullPath " & vbNewLine & _
“return theModDate”

… some other VBA code

strDefaultSearchPath = Application.DefaultFilePath
strScrOpenFilesOutput = MacScript(macscriptGetFilenamesToOpen) ’ This one works like a charm
strFileDateTime = MacScript(macscriptGetFiledatetimeOfModification) ’ This one returns Error 5:
… some other VBA code

At first, it popped a dialog asking where “System Events” was, and I picked the System from the list.
Then, Error 5, in French, is: Argument ou appel de procédure incorrect

Explicit help appreciated, as Mac scripting is all new to me.
Thank you.

Model: MacBook Pro
AppleScript: Apple script 2.1.2
Browser: Safari 534.59.10
Operating System: Mac OS X (10.6)