I tried to execute VBA from VBS from PHP.
~ image ~
<PHP> : exec( fileName.vbs) => <VBS> : Obj.Application.Run "CreateTwinYAxisGraph" => <VBA> : CreateTwinYAxisGraph
The function exec() and VBS worked, but VBA was not ...
And I tried to execute VBS on Command line, VBA function succeeded.
I want to know how to work.
Here is my code.
Dim Obj
Dim FilePath
Set Obj = WScript.CreateObject("Excel.Application")
Set ObjArgs = WScript.Arguments
FilePath = ObjArgs(0)
Obj.Visible = True
Obj.Application.DisplayAlerts = False
CreateObject("WScript.Shell").AppActivate Obj.Caption
Set excel = Obj.Workbooks.Open(FilePath)
Obj.Application.Run "CreateTwinYAxisGraph"
excel.Save
excel.Close
Obj.Quit
Set excel = Nothing
Set Obj = Nothing