Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Excel filename command line parameter to VB

I'd like to execute a macro in Excel automatically using a
VB .exe file. I can do that, but would like to have the
VB file be generic so that it can just receive the
specific Excel file's name as a command line parameter.

Can someone show me how to receive that, in VB? An
example of which portion of the code starts to use it? I
don't think I'm wording this well... sorry.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel filename command line parameter to VB

Mark,

In you program read the parameters using the "Command" function.

Sub Main()
Dim sParam As String

sParam = Command()
MsgBox "The parameters a " & sParam

End Sub

If you pass more than one parameter, e.g. myProj param1, param2, then you
can parse it to separate it out.

--

HTH

RP

"mark" wrote in message
...
I'd like to execute a macro in Excel automatically using a
VB .exe file. I can do that, but would like to have the
VB file be generic so that it can just receive the
specific Excel file's name as a command line parameter.

Can someone show me how to receive that, in VB? An
example of which portion of the code starts to use it? I
don't think I'm wording this well... sorry.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Excel filename command line parameter to VB

Sub Main()
Dim sParam As String
sParam = Command()



Thanks, Bob. That's what I needed to know!

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
First Parameter in INDIRECT command changes if I add new column Delaware Mac Excel Discussion (Misc queries) 2 December 23rd 09 12:04 AM
What are the possible command-line arguments in Excel? d2reason Excel Discussion (Misc queries) 2 June 4th 07 09:39 PM
How to: Pass Command Line Parameter ??? Webtest Excel Worksheet Functions 0 October 24th 05 05:27 PM
Command line parameters to Excel Tom Walker Excel Programming 3 May 23rd 04 06:08 AM
command line excel to run macros Anthony Ryan Excel Programming 0 August 10th 03 02:06 PM


All times are GMT +1. The time now is 05:03 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"