INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Invoke Excel at the command prompt

Invoke Excel at the command prompt

(OP)
I would like to fire up Excel from within a Clipper application, and in the first instance I would like to see if I can fire up an Excel session from the MS-DOS prompt, or from a batch file.

I have optimistically tried these things at the command line :

Run Excel.exe
Start Excel.exe

But without success

Thanks very much.  Andrew

RE: Invoke Excel at the command prompt

Memory issues you may experience aside, the virtual dos window your clipper app is running in needs to know the path to the excel folder. Create an autoexec.nt file in your application folder and store a path statement in it. If you can start excel from the dos prompt the the run command in your clipper app should be able to launch it as well.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel.  Covey

RE: Invoke Excel at the command prompt

(OP)
Thanks Lyndon

The excel program is stored in

C:\program files\Microsoft Office\Office11\excel.exe

I have tried putting that in the path (in the autoexec.nt file);  Although this pathname will then show up (if you key in the DOS command SET), that pathname does not appear to be used by the command processor, probably because of the 8-character limitation on path names in DOS.

One can get round this, by trial and error, by specifying a pathname (on my machine) of C:\progra~1\micros~3\office11, although this would then be dependent on the way that DOS interprets the long filenames ona  particular machine.

If anyone has been able to invoke Excel (and indeed Word) from the DOS prompt I would be grateful to be able to copy their method.  (I am running Windows XP)

Thanks again.

  

RE: Invoke Excel at the command prompt

I just launched excel for a dos prompt in windows 7, same should work in XP.

Then I created a created startapp.bat with these contents:

set path=C:\Program Files\Microsoft Office\Office12
myApp.exe
REM end of batch file


contents of myApp.prg:
run excel.exe
quit
*end of myApp.prg

I compiled w/ clipper 5.2
I LINKED W/ BLINKER 5.0 with no libs external called, however, I created and overlay - myApp.ovl

It launches excel just fine. I used the long file name convention in my path statement.
 

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel.  Covey

RE: Invoke Excel at the command prompt

Andrew,

I've been thinking on this issue and some DVM (DOS Virtual Machine) stuff is starting to come back to me... It's been a long time!

1. In your system folder you should find autoexec.nt and config.nt. Of course these replace autoexec.bat and config.sys from pre-NT operating systems. To make permanent system changes modify these files and every DVM instance will then be affected.

2. To overwrite your path statement use my previous example. Any other DVM instances will unaffected as each instance runs the .nt files independently and maintains its own values.

3. To append to the system path, and not overwrite the system path, replace the set command as follows:

set path=%path%;C:\Program Files\Microsoft Office\Office12

hope this helps

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel.  Covey

RE: Invoke Excel at the command prompt

(OP)
Thanks Lyndon for your patience.

Your recipe (of setting the path, then using the RUN command within my Clipper program, or indeed at the command prompt) works fine.

The reason that it did not work for me appears to be that I was running a session under 4DOS (probably 4DOS 402, I am that much in the past).  And it seems that that starting a separate Excel session from a program running under 4DOS does not work properly.  It certainly finds the file (I get an error message if I 'Run' a non-existent file).  But thereafter Excel does not fire up, and the original program no longer responds to commands, and has to be terminated.

But you have solved my problem.  Thanks.  Andrew Mozley

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close