Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Starting Excel from cmd pmpt, pass parameters

Is it possible to start Excel from a command prompt and
pass it parameters like a DOS/C;Delphi;etc program and
pass it parameters?

I've tried executing it from a cmd prompt like:

C:\.....\excel.exe a b c d

and it thinks a b c d are files.

In mainframe terms, I want to start it like:

// EXEC PGM=EXCEL,PARM='02042004, FULL'

or in a C program be able to read

ArgC, and ArgV

or in Delphi be able to get

ParamCt, ParamStr(0..ParamCt)

I'm actually I'm going to do a create task API call to
start Excel with "ONE" file that has several macros and a
workbook_open() to run the stuff.

But I need to be able to grab a sequential file and read
it, but it will have an "unknown" name so I can't hard
code it and I DON'T want to open it in ANOTHER workbook....

got any clues anyone??

Thanks
JGS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Starting Excel from cmd pmpt, pass parameters

Hi Jerry,

I have a system whereby I run dos batch jobs with lines like this

rem Start the program
"c:\program files\microsoft office\office\excel.exe" MyProgram.xls

where MyProgram.xls reads a initialization workbook (ini.xls) via
workbook_open() and then passes the read parameters onto the various macros
that are in MyProgram.xls

You could also have a c program that has argc, argv that writes into ini.xls
as a csv file which is then open by MyProgram.xls although I have not tried
that.

Regards, Milos.

"Jerry G. Slater" wrote in message
...
Is it possible to start Excel from a command prompt and
pass it parameters like a DOS/C;Delphi;etc program and
pass it parameters?

I've tried executing it from a cmd prompt like:

C:\.....\excel.exe a b c d

and it thinks a b c d are files.

In mainframe terms, I want to start it like:

// EXEC PGM=EXCEL,PARM='02042004, FULL'

or in a C program be able to read

ArgC, and ArgV

or in Delphi be able to get

ParamCt, ParamStr(0..ParamCt)

I'm actually I'm going to do a create task API call to
start Excel with "ONE" file that has several macros and a
workbook_open() to run the stuff.

But I need to be able to grab a sequential file and read
it, but it will have an "unknown" name so I can't hard
code it and I DON'T want to open it in ANOTHER workbook....

got any clues anyone??

Thanks
JGS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Starting Excel from cmd pmpt, pass parameters

Milos:

I figured I could do the same thing from the thread that
does the create task by first writing a file called
xyz.xls and then execute Excel like:

Excel xyz.xls reports.xls

then read the parameters out of the book1 workbook.

I consider that ARCHAIC (no offense intended) ... I should
be able to read parm1 parm2 parm3 REGARDLESS of the fact
that no one (MICROSOFT IN PARTICULAR) tells you how you
can execute Excel via a command prompt... There are
MILLIONS of program people like you and I have to convert,
and that old STANDARD has been summarily dropped,
by "good 'ol Bubbie Gates"....

Thanks for the idea, but I want it to work the way "It
Used To Work" .... the WHOLE WORLD USED TO WORK THAT WAY

.....and then they (MS) stepped in and took it away from
us....

They do not have that right....

Sadly, and with thanks,
JGS

-----Original Message-----
Hi Jerry,

I have a system whereby I run dos batch jobs with lines

like this

rem Start the program
"c:\program files\microsoft office\office\excel.exe"

MyProgram.xls

where MyProgram.xls reads a initialization workbook

(ini.xls) via
workbook_open() and then passes the read parameters onto

the various macros
that are in MyProgram.xls

You could also have a c program that has argc, argv that

writes into ini.xls
as a csv file which is then open by MyProgram.xls

although I have not tried
that.

Regards, Milos.

"Jerry G. Slater" wrote in message
...
Is it possible to start Excel from a command prompt and
pass it parameters like a DOS/C;Delphi;etc program and
pass it parameters?

I've tried executing it from a cmd prompt like:

C:\.....\excel.exe a b c d

and it thinks a b c d are files.

In mainframe terms, I want to start it like:

// EXEC PGM=EXCEL,PARM='02042004, FULL'

or in a C program be able to read

ArgC, and ArgV

or in Delphi be able to get

ParamCt, ParamStr(0..ParamCt)

I'm actually I'm going to do a create task API call to
start Excel with "ONE" file that has several macros and

a
workbook_open() to run the stuff.

But I need to be able to grab a sequential file and read
it, but it will have an "unknown" name so I can't hard
code it and I DON'T want to open it in ANOTHER

workbook....

got any clues anyone??

Thanks
JGS



.

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
how do you pass the prove it test for Microsoft Excel? jerry New Users to Excel 4 April 7th 23 12:17 PM
Pass a time value from Excel to Outlook appointment splodgey Excel Discussion (Misc queries) 2 October 18th 07 11:17 AM
how to pass on different parameters to VBA Code? Ahmaq Excel Worksheet Functions 2 April 22nd 07 04:30 AM
How do I my find pass word in excel AlShepard Setting up and Configuration of Excel 0 February 6th 06 09:32 PM
Starting a userform upon starting the file Fritznel Excel Programming 1 July 28th 03 05:37 AM


All times are GMT +1. The time now is 03:12 AM.

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

About Us

"It's about Microsoft Excel"