View Single Post
  #4  
Old 08-22-2006, 06:15 AM
NickHK
Guest
 
Posts: n/a
Re: Run macro from command line

Alan,
You can control Excel from the command line like that as there is nothing to
interpret the arguments.
Here's the standard command line switches available:
http://support.microsoft.com/default.aspx?kbid=291288

So you will need a macro or VBS/Automation to control Excel.
(Or you could use DDE if your desperate)

NickHK

"Alan Wilson" <Alan.Wilson.2cxr9r_1156240506.8037@excelforum-nospam.com>
wrote in message
news:Alan.Wilson.2cxr9r_1156240506.8037@excelforum-nospam.com...
>
> Nick
>
> Yes, process_create() is similar to Shell.
> If I can pass the filename to SaveAs as a parameter in the command
> line, then perhaps a macro would not be needed: how could I do this? Is
> there a definitive list of command line options somewhere?
>
> Thanks
> Alan
>
> NickHK Wrote:
> > Alan,
> > What is "process_create" ? Similar to Shell ?
> >
> > You could specify a workbook that has a suitable routine in its
> > Workbook_Open event instaed of the "file.txt".
> > And there are ways to read the command line to Excel so you can pass
> > more
> > parameters, e.g. the text file to open, the .SaveAs file name etc.
> >
> > Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA"
> > () As
> > String
> >
> > But still need a macro in the WB open to do the saving.
> >
> > Or use a VBScript + Automation
> >
> > NickHK

>
>
> --
> Alan Wilson
> ------------------------------------------------------------------------
> Alan Wilson's Profile:

http://www.excelforum.com/member.php...o&userid=37858
> View this thread: http://www.excelforum.com/showthread...hreadid=574090
>



Reply With Quote