Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Start an Application
How do I write a macro to start another application?
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Start an Application
Joe, something like this, to run notepad
Sub Run_Notepad() Run Shell("C:\WINDOWS\NOTEPAD.EXE", 1) End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Joe Teixeira" wrote in message ... How do I write a macro to start another application? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Start an Application
That has worked great for Notepad and Calculator, but when I tried to use it
to open an estimating application called Costworks, Costworks only opened "halfway". I closed Costworks and tried to open it directly from it's shortcut and it opened just fine. I tried increasing the numeric value at the end of the Run Shell line to 2 (no luck) and then to 3 (no luck). I thought that the Run Shell command wasn't giving the application enough time to open and by changing those values it would give the application more time to open. I have a support agreement with the estimating application's publisher but this is out of the agreement's scope. "Paul B" wrote: Joe, something like this, to run notepad Sub Run_Notepad() Run Shell("C:\WINDOWS\NOTEPAD.EXE", 1) End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Joe Teixeira" wrote in message ... How do I write a macro to start another application? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Start an Application
Shell doesn't wait for anything. It simply starts the program
and VBA code execution move to the next line of code. If it takes some time to fully open your application, you could use Application.Wait to pause Excel, giving the program enough time to fully start up. Shell "your_program.exe" Application.Wait Now + TimeSerial(0, 0, 15) 'wait 15 seconds ' more code The code above will start "your_program.exe" then wait for 15 seconds, giving your_program.exe time to fully get itself together, then continue on with VBA code. Change the 15 to the number of seconds you feel is appropriate. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Joe Teixeira" wrote in message ... That has worked great for Notepad and Calculator, but when I tried to use it to open an estimating application called Costworks, Costworks only opened "halfway". I closed Costworks and tried to open it directly from it's shortcut and it opened just fine. I tried increasing the numeric value at the end of the Run Shell line to 2 (no luck) and then to 3 (no luck). I thought that the Run Shell command wasn't giving the application enough time to open and by changing those values it would give the application more time to open. I have a support agreement with the estimating application's publisher but this is out of the agreement's scope. "Paul B" wrote: Joe, something like this, to run notepad Sub Run_Notepad() Run Shell("C:\WINDOWS\NOTEPAD.EXE", 1) End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Joe Teixeira" wrote in message ... How do I write a macro to start another application? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions | |||
Display form from an VB application in Excel | Excel Discussion (Misc queries) | |||
macro to start on workbook opening | Excel Discussion (Misc queries) | |||
enter data in cell which will start macro to move data to sheet2 | Excel Discussion (Misc queries) |