I am trying to run an Excel VBA procedure from Access and can't figure out how to send the required parameter. This works for running one that does not require a parameter:
xlApp.Run sFileName & "!" & sMacroName
this is the subroutine Sub FormatDollars(MonthEnd As String)
this is what I tried:
xlApp.Run sFileName & "!" & sMacroName & ", '" & CStr(MEnd) & "'"
and
xlApp.Run sFileName & "!" & sMacroName & ", " CStr(MEnd)
Access breaks on this line. Error 1004, Cannot run the macro 'FormatFile.xlsm!FormatDollars, 201412' this macro may not be available.....
if I am right, it is reading the parameter as part of the macro name and not a parameter.
any help is appreciated.