Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Joe Teixeira
 
Posts: n/a
Default Macro to Start an Application

How do I write a macro to start another application?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Joe Teixeira
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM
Display form from an VB application in Excel kuhni Excel Discussion (Misc queries) 0 August 10th 05 06:04 PM
macro to start on workbook opening Nigel Excel Discussion (Misc queries) 1 May 13th 05 12:39 PM
enter data in cell which will start macro to move data to sheet2 Tommy Excel Discussion (Misc queries) 0 May 12th 05 05:00 PM


All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"