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.