Your Products have been synced, click here to refresh
@ echo Off echo Processing. This could take several minutes. Please wait... @ echo off cscript //Nologo "PATH_TO_YOUR_VBSCRIPT_HERE.vbs" %1 %2 %3 %4 %5 %6 %7 %8 %9
Option Explicit Dim args,macro,num Set args = WScript.Arguments macro = args.Item(0) Select Case macro Case "Macro1" num = args.Count If num = 3 then Macro1 args.Item(1), args.Item(2) else MsgBox "Incorrect Number of Arguments Passed",0,"Error!" End If Case "Macro2" num = args.Count If num = 5 then Macro2 args.Item(1), args.Item(2), args.Item(3), args.Item(4) else MsgBox "Incorrect Number of Arguments Passed",0,"Error!" End If Case Else MsgBox "Macro Name Not Recognized",0,"Error!" End Select Sub Macro1(arg1, arg2) Dim xl Dim xlBook Dim sPath sPath = "C:\YourPath\" Set xl = CreateObject("Excel.application") Set xlBook = xl.Workbooks.Open(sPath & "Your_Excel_Wrkbk.xlsm", 0, True) xl.Application.Visible = False xl.run "module1.Macro1", Cstr(Arg1), Cstr(Arg2) xl.Quit Set xlBook = Nothing Set xl = Nothing End Sub Sub Macro2(arg1, arg2, arg3, arg4) Dim xl Dim xlBook Dim sPath sPath = "C:\YourPath\" Set xl = CreateObject("Excel.application") Set xlBook = xl.Workbooks.Open(sPath & "Your_Excel_Wrkbk.xlsm", 0, True) xl.Application.Visible = False xl.run "module1.Macro2", Cstr(Arg1), Cstr(Arg2), CDbl(Arg3), CInt(Arg4) xl.Quit Set xlBook = Nothing Set xl = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |