Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Store sorting argument in Excel Kvant the theory Excel Worksheet Functions 2 August 21st 08 09:50 PM
Pass cell contents to external program as commandline option Research freak Excel Discussion (Misc queries) 1 September 16th 05 11:03 PM
Excel 2003 Slow Function Argument Window [email protected] Excel Discussion (Misc queries) 2 June 28th 05 06:53 PM
Passing argument to excel rci Excel Programming 2 February 25th 05 01:27 PM
Commandline Arguments Tim[_16_] Excel Programming 2 July 25th 03 06:59 AM


All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"