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

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

0
6/4/2007 11:14:14 AM
excel 39879 articles. 2 followers. Follow

2 Replies
1004 Views

Similar Articles

[PageSpeed] 27

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


"kilter" <richard.pitman3@btopenworld.com> wrote in message 
news:1180955654.898401.229870@p47g2000hsd.googlegroups.com...
> 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
> 


0
Bernie
6/4/2007 3:27:01 PM
"Bernie Deitrick" <deitbe @ consumer dot org> wrote...
>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

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.

0
hrlngrv1 (375)
6/4/2007 8:28:00 PM
Reply:

Similar Artilces:

shortcut with command line switch probs
Hello, I have a shortcut set up which has the target declared as: "C:\Program Files\Microsoft Office\Office\EXCEL.EXE" / "\\path_to_file\myfile.xlt" This works fine on my PC. Excel 2000 running on Windows XP. Unfortunately it doesnt work on someone elses PC, who asked for m help! They have the same software set up, and access to the same folde path. When they try to run the shortcut, a window opens and closes almos immediately. Help?! : -- soloto ----------------------------------------------------------------------- solotoo's Profile: http://www.excelforum.com/m...

Create Exchange mailbox from command line
I'm writing a script using dsadd and I was wondering if it's possible to create an exchange mailbox from the command line. Donovan Maybe not exactly what you want but it may help: http://www.joeware.net/win/free/tools/exchmbx.htm -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexchangeblog.com "Donovan Linton" <DonovanLinton@discussions.microsoft.com> wrote in message news:D9C839EF-883D-4E2E-8BE9-57782582F043@microsoft.com... > I'm writing a script using dsadd and I was wondering if it's possible to > create an ...

building from a command line (VC6)
Where can I found more info about building projects from command line? I've only until now built projects using IDE. I'd like to make a script that would build all my projects and stop building if error occure. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/_asug_building_a_project_from_the_command_line.asp -- --------------------------------------------------- Automate your software builds with Visual Build Pro http://www.kinook.com "Miki Peric" <blah@ccc.com> wrote in message news:elC92A9REHA.3628@TK2MSFTNGP12.phx.gbl... > &...

Does Office 03 supply a sendmail command line function?
I have some web code that uses the Unix sendmail function. Does Office 03 or Windows XP supply an analogous command line function? TIA, Pete ...

Outlook command line switches?
Hi, does anyone know any *extra* command line switches for outlook? I know all the normal ones about changing directories, and views etc. Im more interested in actually creating a new email with all the fields pre-filled in. for example, i know i can do: outlook /c ipm.note /m me@me.com Which will create a new email message already addressed to me@me.com. But are there switches available for the subject and body? and / or setting it to HTML / plain? Cheers Here is the latest list of switches documented in the Outlook 2003 help file : Switch Description /a Creates an i...

CreateProcess command line
Hi, I'm trying to recreate a straight forward command line call to initialise a SQL Express installation. The path I need to pass, including parameters, is as follows "sqlexpr32\\setup /qb /settings sqlexpr32\\template.ini" and my call to CreateProcess is as follows CreateProcess( NULL, // app name tcCmdLine, // command line NULL, NULL, // process security, thread security FALSE, // inherit handles CREATE_DEFAULT_ERROR_MODE, // flags NULL, // environmen...

comparing excel spreadsheets from command line
Hi, I am running tests here that involve comparing two excel spread sheets. right now we have to manually open the files, copy and paste the contents of each into a separate too, and run a compare. This is time consuming as it involves an awful lot of manual intervention. Ideally, I would like to run some sort of command that takes the two files as params and which outputs (preferable in some sort of graphical format) the differences between the two files. Is that possible? Or am I asking too much? thanks much and have a nice day Graham hi, see this site. http://www.cpearson.com/ex...

How to start cluster from command line?
We are running Windows 2003 domain and Exchange 2003 cluster. I had to take ALL of the cluster resources offline install a Microsoft fix. Now the cluster won't show up in Cluster Administrator so I can't bring the cluster back online. Anyone know the command line commands to do this, or how I open a connection to the cluster in Cluster Administrator? TIA, Lamar The virtual node name is "stms". Whe I try to connect to that cluster it says that the cluster service is not running on that node. Lamar "Lamar Thomas" <none@none.com> wrote in me...

Printing from command line
Good morning: Does anyone know of a way to print an Excel document from a command line? Thanks, Al On Apr 17, 10:58 am, "Al" <n...@no.com> wrote: > Good morning: > > Does anyone know of a way to print an Excel document from a command line? > > Thanks, > > Al Good evening Al, See http://www.robvanderwoude.com/index.html ...

Compiling from command line with macros
Hey, I am building a system that would build our product from command line on a regular basis. Calling msdev from command line is really easy, but I am now having trouble incrementing the version numbers of each build. I followed this KB article http://support.microsoft.com:80/support/kb/articles/Q237/8/70.ASP to make a VBScript macro that increments the version information on each succesful build. It works like a charm when built from VC++ IDE. The problem is to make it apply to command line builds as well. So the question is, can I compile a workspace from command line so that it would be...

Need help Outlook command line options
I'm trying to find out how to launch a new mail message in Outlook from a command line. I looked in the help and found the list of command line options, but I'm having problems trying to combine them. Here's a list of commands I'm using: Open a new mail message: outlook.exe /c ipm.note Open a new mail message and populate sender: outlook.exe /c ipm.note /m someone@microsoft.com Open a new mail message with attachment: outlook.exe /c ipm.note /a filename All of these work fine, but when I try to specify a recipient e-mail address and an attachment, I get an error messag...

How can I remove service from Outlook via command line?
Is there any way to remove the Internet Mail service from Outlook via a command line? I want to remove the Internet Mail service from all Outlook clients in the corporation using a logon script or SMS package. Thanks. Greg ...

How to redirect the output of a command line into a file?
Hi All inside my build scripts, I'm calling a command line that I need the output to be shown in the window as well as to be saved in a file. something like TEE in unix. can anyone tell me how to do it ? Thanks example: cl.exe [your options] > c:\file.txt this will creates the file and insert the output of cl.exe cl.exe [your options] >> c:\file.txt this will appends the the output to the file i think it's a batch file! -- kind regards, muechel ...

Command Line/Script to Remove/Uninstall Program that can only be removed from Add or Remove Programs
Hello all, I need to come up with a command line/script to uninstall a program that can only be removed from Add or Remove Programs. Can anyone point me in the right direction to websites/tutorials/walk-thru's. Thanks for any help anyone can provide, Conan Kelly --------------------------- "Smokin' weed kills your brain cells. Drinkin' only screws up your liver...ya got 2 a those." - Earl Hickey (NBC's "My Name is Earl") If Milli Vanilli falls in the woods, does someone else make a sound? "Conan Kelly&...

Backup from a command line?
I would like users to be able to create a backup from a shortcut on our shared drive instead of from within Access. I don't want to just copy the file but rather create a backup like Access does (with the date as part of the file name). Can someone help? Thanks! Joe M. Joe, Sounds like some new 2007 "backup" feature, which I haven't used yet... Since your doing this from outside Access, why not just use a freeware backup program that you can schedule (like Cobian Backup). The Created/Modified date would always indicate what Date and Time the Backup...

Outlook 2003 Command Line Switches
Hello, I was trying to use some command line switches when starting Outlook to create a new message and I received an error when combining a few switches. This worked in opening a new message with an attachment: "C:\Program Files\Microsoft Office\Office11\Outlook.Exe" /c IPM.Note /a "Foo.Pdf" /NoPollMail This worked in opening a new mail message with the TO name filled in: "C:\Program Files\Microsoft Office\Office11\Outlook.Exe" /c IPM.Note /m john@abc.com /NoPollMail However, when I tried to combine the /a and /m, I received an error about Command Line ...

How to catch the output from a command line application?
Hi, In my application, I want to call a command line application. Based on the output from the comman line application, I want to perform operations. To be more clear, 1. I have a windows application "MyApplication". 2. On OK button click, I want to call a command line application "CmdAppl". (This command line application returns 0 in case of success and -1 or -2 in case of different errors). I want to capture the return value of this command line application and proceed further if it returns ZERO (0) or else stop further execution. Please suggest a solution how can I proc...

Outlook 2K: Startup: automaticly Chose Profile with parameter/command line?
Hi, I have two profiles for my Outlook 2000 instance. Instead of having to chose everytime the Profile on startup, I want two shortcuts on my Desktop, one for each Profile. So when I click on shortcut one it opens Outlook with Profile A, and when i click on shortcut B it opens Outlook with Profile B. I found this for Outlook 2003: "C:\Program Files\Microsoft Office\Office\OUTLOOK.exe /profile MyProfile", but it doesn't seem te work on Outlook 2000. does somebody knows the right way to do this in Outlook 2000, Thanks a lot in advance! Pieter Ok I found it myself: it's ...

Exchange Router Install
I appear to have CRM server up and running fine and have just come across a problem when trying to install the Exchange E-mail Router. I step through the installation wizard and all of my input is accepted fine. As soon as the installer starts though, I am getting "Invalid command line argument - consult the windows installer SDK for detailed command line help (80070667) I can only think that one of the arguments that were passed to the command line wasn't acceptable - Any Suggestions??? Thanks Figured it out - We were using strong passwords for the account we were installing un...

How to find out OS edition from command line?
Hi folks, do you know how to find out OS edition from OS line? "Gene." <Gene@discussions.microsoft.com> wrote in message news:94C9D953-5395-4E42-A92D-3F81AC34034D@microsoft.com... > Hi folks, do you know how to find out OS edition from OS line? Winver Jim On Thu, 29 Apr 2010 15:09:01 -0700, Gene. <Gene@discussions.microsoft.com> wrote: >Hi folks, do you know how to find out OS edition from OS line? ver -- ---------------- Stubbo of Oz ---------------- On Fri, 30 Apr 2010 09:48:08 +1000, Stubbo of Oz <stubbo@invalid.invalid>...

how to send email in command line?
Hi, I am using Outlook 2003.I have a bunch of jpg files need to send out as email attachment. The only option I have is to run some command script so that 1) all the emails are constructed with email address and attachment are taken care and 2) all of them are sent out. If the 2nd request is not possible, it is ok, I can click "Send" button on all the constructed emails. I checked out that Outlook has some command switches, such as,/a for attachment, this should work for me, but I have some problem. I run command like this, "outlook.exe /a path\myfile /m someone@somewher...

Re: Sending email from command line
I'd like to do this! Can anybody say how? "Brandi" <ab@mdahospital.com> wrote in message news:... > Was I not clear in my question or does anybody know that this isn't > possible? > > "Brandi" <ab@mdahospital.com> wrote in message > news:OFY$VDjfEHA.368@TK2MSFTNGP10.phx.gbl... > > I have a txt file that contains a list of records. Each record contains an > > email address and some other data. The file is created every night. Every > > morning, someone reads the file and manually creates email to send the > > appro...

Parsing command line parameters in a setup and deployment application
Hi. I'm new to making setup and deployment projects, and wonder if it's is possible to parse command line parameters passed by the user. For example, I want UI of my setup application to be derived from the command line parameter: 'setup.exe /enu' - must use English UI 'setup.exe /hye' - must use Armenian UI How to achive that, i.e. how to parse parameters from the command line in a setup and deployment project, if it's possible, of course? Thanks in advance, Martin ...

command line options?
Is there a list of command line options for IE? I am using IE8 currently. Thank You.. FeedScrn wrote: > Is there a list of command line options for IE? I am using IE8 > currently. > > Thank You.. Courtesy of my colleague MVP Kai Sch�tzl: http://iefaq.info/index.php?action=artikel&cat=42&id=145&artlang=en "Command-line parameters for IE8". -- Vincenzo Di Russo Microsoft� MVP - Most Valuable Professional since 2003 Windows Internet Explorer, Windows Desktop Experience & Security My MVP Profile: https://mvp.support.microsoft.com/profi...

NT Backup Command Line
Does anyone have an example of their NT Backup Command line of the /IS and /DS. Microsofts examples are not very clear and I don't want to fail the backup. Fred One thing you might find easier - if you use NTBackup to create a .bks file that specifies the sources you wish, you can use a batch file that refers to that .bks file - plus any other switches you might like, such as ones to overwrite any tape in the drive, eject the tape after use, etc.... Fred wrote: > Does anyone have an example of their NT Backup Command line of the > /IS and /DS. Microsofts examples are not very...