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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

cherria

Well-known Member
Joined
Nov 17, 2004
Messages
708
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
 

~Zodiac~

Board Regular
Joined
Jan 10, 2005
Messages
70

ADVERTISEMENT

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?
 

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
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)
 

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
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.)
 

~Zodiac~

Board Regular
Joined
Jan 10, 2005
Messages
70
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"
 

Forum statistics

Threads
1,147,621
Messages
5,742,193
Members
423,710
Latest member
Duarte85

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
Top