I have a powerpoint file with the following macro:
Sub test(msg$)
MsgBox msg
End Sub
I have a vbscript file that looks like this:
Option Explicit
On Error Resume Next
RunMacro
Sub RunMacro()
Set ppApp = CreateObject("Powerpoint.Application")
Set ppPres = ppApp.Presentations.Open("test.pptm", 1)
ppApp.Run "test.pptm!test ""my message here"" "
ppApp.Quit
Set ppPres = Nothing
Set ppApp = Nothing
End Sub
But I can't seem to pass the string parameter to the macro (no message box shows up in PPT). I'm guessing something is wrong with the number of quotation marks, but I've tried every permutation I could think of and nothing works. If I hard-code the message in the macro everything works fine.
Related (tried these, with no luck)