Re: Run macro from command line



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.2cxoq2_1156237205.3892@xxxxxxxxxxxxxxxxxxxxx>
wrote in message
news:Alan.Wilson.2cxoq2_1156237205.3892@xxxxxxxxxxxxxxxxxxxxxxxx

I can open a tab-separated file automatically from the command line, eg
process_create("excel.exe","file.txt"), but then I want to Save As an
Excel file: I can create a macro to do that, but how can I run the
macro automatically, on the command line?
Any help appreciated!


--
Alan Wilson
------------------------------------------------------------------------
Alan Wilson's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=37858
View this thread: http://www.excelforum.com/showthread.php?threadid=574090



.



Relevant Pages

  • Re: FORMS
    ... At the end of the form I want a command button that when pressed will save ... > entered into the formfield and a macro run on exit from a field could use ... Adding Automation to your Word forms. ...
    (microsoft.public.word.vba.general)
  • Run macro from command line
    ... I can open a tab-separated file automatically from the command line, ... Excel file: I can create a macro to do that, but how can I run the ... Alan Wilson ...
    (microsoft.public.excel.programming)
  • Re: Run macro from command line
    ... You can control Excel from the command line like that as there is nothing to ... So you will need a macro or VBS/Automation to control Excel. ... Alan Wilson ...
    (microsoft.public.excel.programming)
  • Re: Junk messages
    ... "Here's one example of how it works: I mention that UG and lots of other CAM ... companies have their own basic macro automation / customization language and ... ... VBA is a "macro language" that one can use in many, ...
    (alt.machines.cnc)
  • Re: Insert File not working
    ... Go to Tools | Macro | Macros and see if there is an InsertFile macro listed ... is the window opening behind your document? ... "Debutante" wrote in message ... then the command isn't working at all. ...
    (microsoft.public.word.newusers)