L
Lieven Roelens
Hi,
I'm trying to call a macro with 1 argument from VBScript
but the VBA code doesn't get executed.
I've no problem when calling a macro without arguments.
Is it possible to call a Excel macro with arguments
through automation?
VBScript:
Const vbNormal = 1 ' window style
DIM objXL, objWb ' Excel object variables
Set objXL = WScript.CreateObject ("Excel.Application")
objXL.WindowState = vbNormal
objXL.Visible = true
Set objWb = objXL.WorkBooks.Open("C:\TEMP\test.xla")
objXL.Run "data_pump","C:\TEMP\test.xml"
xla VBA code
Public Sub data_pump(sFileUri As Variant)
Application.Workbooks.Open (CStr(sFileUri))
End Sub
Thanks for the support,
Lieven
I'm trying to call a macro with 1 argument from VBScript
but the VBA code doesn't get executed.
I've no problem when calling a macro without arguments.
Is it possible to call a Excel macro with arguments
through automation?
VBScript:
Const vbNormal = 1 ' window style
DIM objXL, objWb ' Excel object variables
Set objXL = WScript.CreateObject ("Excel.Application")
objXL.WindowState = vbNormal
objXL.Visible = true
Set objWb = objXL.WorkBooks.Open("C:\TEMP\test.xla")
objXL.Run "data_pump","C:\TEMP\test.xml"
xla VBA code
Public Sub data_pump(sFileUri As Variant)
Application.Workbooks.Open (CStr(sFileUri))
End Sub
Thanks for the support,
Lieven