Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Starting a "command line" .exe program from within an excel spreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kilter - 04 Jun 2007 12:14 GMT
Is there a way to link an external .exe file to a button on a
worksheet. I have a fortran program, which carries out a set of
analyses, that I would like to be able to call from a worksheet.

Many thanks

Richard
Bernie Deitrick - 04 Jun 2007 16:27 GMT
Richard,

Attach a macro to the button, along the lines of

Sub RunDOSProgram()
Dim myProgram As String
myProgram = "C:\Program Files\BlahBlah.EXE -s"
TaskID = Shell(myProgram, 1)
End Sub

I don't have any old DOS execeutables to test, so.....

HTH,
Bernie
MS Excel MVP

> Is there a way to link an external .exe file to a button on a
> worksheet. I have a fortran program, which carries out a set of
[quoted text clipped - 3 lines]
>
> Richard
Harlan Grove - 04 Jun 2007 21:28 GMT
"Bernie Deitrick" <deitbe @ consumer dot org> wrote...
>Richard,
>
[quoted text clipped - 5 lines]
>TaskID = Shell(myProgram, 1)
>End Sub

This runs the program in parallel with Excel, i.e., synchronously. If
the OP wants the outside program to complete before the Excel macro
continues, better to use the macro found in the following linked
article in the archives.

http://groups.google.com/group/microsoft.public.excel.misc/msg/9a750a70b8ec3190

>I don't have any old DOS execeutables to test, so.....
...

Really?! Not even COMMAND.COM, DEBUG.COM or EDLIN.COM, all of which
are 16-bit programs still installed by default up through Windows XP.
Dunno about Windows Vista, but any .COM file is a 16-bit program, and
I suspect there are still a few lurking in Vista.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.