How to start a program with a macro

~Zodiac~

Board Regular
Joined
Jan 10, 2005
Messages
70
what code must i use to start a program with excel? (something outside the office programs)

pls help me out

Thanks in Advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The function you need is called Shell but I can find no reference to it in the VBA help.

There are 2 versions I think, Shell and Shellandwait

try searching for Excel VBA Shell in google
 
Upvote 0
is it possible to let a excel macro to activate buttons in a program opened with the shell code?

if so, what code is used for that?
 
Upvote 0
cherria said:
The function you need is called Shell but I can find no reference to it in the VBA help.

There are 2 versions I think, Shell and Shellandwait

try searching for Excel VBA Shell in google

LOL, shellandwait is a usermade version :lol: it has something to do with apicalls and stuff. What it does is execute a file and wait until it is closed (useful for using winzip etc)
 
Upvote 0
Also, when you use the shell command, you can retrieve the program ID ( myProgram = shell(...) )
you can use it to activate it with AppActivate (myProgram)
Take a look at the SendKeys command for controlling other programs through VBA.

(P.S. Als je AppActivate wilt gebruiken, moet je oppassen met releaseversieverschillen. Ik heb t ook gebruikt en op sommige versies crasht ie zonder reden op AppActivate.)
 
Upvote 0
Thanks for your reply Harvey

@Harvey ps heb je mijn pm over die topic al gelezen? (de topic van die zimbabwaan die over opslaan ging)

i need the macro to 'click' on a button that is 1 milimeter left of the words "equipment recipe usage", then it has to 'click' on a line with the text "to run"
 
Upvote 0

Forum statistics

Threads
1,222,227
Messages
6,164,717
Members
451,912
Latest member
HMF009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top