1) In the workbook with the macro (located at C:\subdirectory\workbook.xls), set up an Auto_Open macro that will execute when the workbook opens. In that Auto_Open code, put the macro code or put the sub name for the macro code you want to run.

The /e option opens Excel without the splash screen and blank workbook.

I hope this helps.

0

KCChanAuthor Commented: 2003-02-27

Thanks Moliere, but i got the complete solution from the URL that cri has posted. This is one of the paragraph that i hav taken from there:

POWER PROGRAMMING TECHNIQUE

By Laurent Longre

There is a way for an auto-start macro to read the arguments on the
command line (with Excel 97).

Assume that you want to read the command line argumentsfrom an Auto_open
sub in the workbook "c:\temp\test.xls" opened by a batch file (or by a
Win95 shortcut).

Your command line should look like this one:

start excel c:\temp\test /e/param1/param2/.../paramN

i.e. : after excel.exe, the name of the workbook containing the
Auto_open, then the switch /e **immediately** followed by your own
arguments. These arguments should be separated by "/" and form a
continuous string without spaces.