Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
commandline argument in excel 2003
I want to pass command line argument to to the VBA code in EXCEL 2003. I
cannot use Command() or COmmand$(). Kindly suggest how should i go about it? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
commandline argument in excel 2003
From "Microsoft Visual Basic Help":
"The Visual Basic Command function is not available in Microsoft Office applications." So forget about the command() function. You might have to consider using Office Automation. If you are familar with visual basic you can do automation with Windows Scripting Host: - create a Windows Scripting Host file that creates an excel application object. - call the run method on the object passing the macro name that you want to execute + command line arguments Something like this: ' --------------------------- ' automate.vbs ' --------------------------- Dim app, wb, args Set args = WScript.Arguments Set app = CreateObject("Excel.Application") Set wb = app.Workbooks.Open("c:\myfile.xls") app.Run "Module1.MyMacro", args(0) wb.Close app.Quit Set wb = Nothing Set excel = Nothing ' --------------------------- Try calling automate.vbs from command line prompt, e.g. c:\ automate.vbs param1 param2 Hope this helps -- arunkhemlai "gonnyv" wrote: I want to pass command line argument to to the VBA code in EXCEL 2003. I cannot use Command() or COmmand$(). Kindly suggest how should i go about it? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
commandline argument in excel 2003
Hi gonnyv,
Look : http://www.google.fr/groups?hl=fr&lr...5a7f0&s eekm= Od3YRGRDFHA.1296%40TK2MSFTNGP10.phx.gbl#link4 MP "gonnyv" a écrit dans le message de news: ... I want to pass command line argument to to the VBA code in EXCEL 2003. I cannot use Command() or COmmand$(). Kindly suggest how should i go about it? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Store sorting argument in Excel | Excel Worksheet Functions | |||
Pass cell contents to external program as commandline option | Excel Discussion (Misc queries) | |||
Excel 2003 Slow Function Argument Window | Excel Discussion (Misc queries) | |||
Passing argument to excel | Excel Programming | |||
Commandline Arguments | Excel Programming |