+ Reply to Thread
Results 1 to 2 of 2

Open an .exe file using a command shell

  1. #1
    Registered User
    Join Date
    10-17-2011
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    79

    Open an .exe file using a command shell

    Hi all,

    My final goal is to automate the process below. I prefer to explain my final goal since people could see potential issues that I have not foreseen in a simpler problem. But to keep things shorter, I will write farther below this simpler problem as an example of what I don't know how to do.

    1-open a command shell (cmd.exe)
    2-from the shell, launch a program ProgTest.exe calling a save file SaveTest.txt using the following syntax C:\...\ProgTest.exe C:\...\SaveTest.txt The result of this program is stored in memory as a set of lines with a format like:
    id1;2;;;d;3;
    id2;;t;;r;;
    id3;A;;5;;8;
    etc.
    3-paste what is stored in memory in a spreadsheet (A1 receives id1;2;;;d;3; /A2 receives id2;;t;;r;; etc.)
    4-then use the Excel tool "Text to columns", using Semicolon as a delimiter.
    5...

    If I could get the code to do what is below, I think that I should be able to take care of the remaining.

    Having in A1 the following string "calc.exe", click on a button to launch the following macro:
    1- copy the string from A1 ("calc.exe")
    2- open the Command shell (cmd.exe)
    3- paste the memory content
    4- validate (Enter) the command and launch Calculator
    5- go to A2
    6- paste the memory content in A2 (still "calc.exe" in this case, but it should be the result from a program). Usually I know this part but I am not sure that this won't require some extra care since we left Excel to the command shell at some point.

    I hope that this is clear enough,
    Thank you for any help,
    Regards.

  2. #2
    Registered User
    Join Date
    10-17-2011
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    79

    Re: Open an .exe file using a command shell

    Without providing the code, could someone having the knowledge tell me if this is possible or not? If it is, I will keep looking on the forums.
    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Shell command to open website under a specific ID
    By mattyp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 10:26 AM
  2. shell to open external bat file
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2013, 12:28 AM
  3. Use Shell command to open another app maximised
    By AndyCotgreave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2012, 01:09 PM
  4. Open File problem using Shell command
    By roelvdh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2010, 03:41 PM
  5. [SOLVED] send parameters to a batch file with the shell command
    By Marcos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-28-2006, 03:00 PM
  6. [SOLVED] getting vba shell command to execute batch and save output to a file
    By Mad Scientist Jr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2006, 10:10 AM
  7. how shell open AcroReader w/command line filename?
    By Ian Elliott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2005, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1