PowerPoint 2003 macro to auto run .exe file

I have a PowerPoint presentation and on one of the slides I have a button to play an .exe file, I have located in the same folder.  When I click to play the file the usual warning message pops up:
Some files can contain viruses..yada yada yada....Would you like to open this file? um, yes...

is there a way around this? i saw an another post adding this into the macro for the page, but it didn't work:
Dim RetVal
RetVal = shell("C:\myfile.exe",1)

My last resort has been to set my security to "LOW" temporarily when I want to run PowerPoint presentations; which is very frequent.  I'd rather add a macro w/the correct coding to have it run automatically.  Just in case I forget to change the security settings back.
mdmcq5Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

byundtMechanical EngineerCommented:
Hi mdmcq5,
I'm not getting the warning message. But if you are, consider surrounding your Shell statement with code to turn alerts off and then back on:

Private Sub CommandButton1_Click()
Dim RetVal
Application.DisplayAlerts = False
RetVal = Shell("C:\Program Files\IrfanView\i_view32.exe", 1)
Application.DisplayAlerts = True
End Sub

Cheers!

Brad
0
mdmcq5Author Commented:
I'm not powerpoint guru & the presentation wasn't created by me & actually dont know how they added the button that leds to the .exe. But, anyway, if I just add this coding into a macro on that particular slide, the message should no longer appear?

& this line I should change to were the .exe file resides?
RetVal = Shell("C:\Program Files\IrfanView\i_view32.exe", 1)

& where can I check on this particular page to be certain they have named this linked button as CommandButton1?
0
byundtMechanical EngineerCommented:
mdmcq5,
If you right-click on the button (while in slide editing mode), you can choose "Properties" from the resulting pop-up. The name of the button is the "(Name)" property at the top of the Properties dialog.

If you choose "View code" after right-clicking the button, you will see the macro linked to that button.

I'm not a PowerPoint wizard either--but I do know my way around VBA. If you can find the statement that launches the .exe file in the macro, try surrounding it with the two statements in my previous post to turn Alerts off and then back on. I used the RetVal=Shell(... statement in my test presentation just  because that was the code you posted, and IrfanView was a handy .exe file to try running.
Brad
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mdmcq5Author Commented:
I'll take a look tomorrow; file on PC there. And will attempt your coding suggestion. Keep ya posted!
0
bruintjeCommented:
Hello mdmcq5,

>> When I click to play the file the usual warning message pops up:
>> Some files can contain viruses..yada yada yada....Would you like to open this file? um, yes...

that warning only pops up when opening the powerpoint file not when running the code behind the button on button click so you do not need any additional code, turning off the security warnings under macro | security was enough

here is a sample ppt file containing that code which is familair ;-)

source: http://www.traktiq.net/ee_temp/ppt_21781745.ppt
----------
1. open your powerpint presentation
2. show the toolbox through view | toolbox
3. drag a button to the slide
4. doubleclick the button
5. the resulting eventhandler looks like

Private Sub CommandButton1_Click()

End Sub

6. add your lines to make it look like

Private Sub CommandButton1_Click()
  Dim RetVal
  RetVal = Shell("C:\myfile.exe", 1)
End Sub

7. change the path to your exe, eg this line

"C:\myfile.exe"

8. close the vb editor
9. run the presentation and click the button
----------

just comment on the results

hope this helps a bit
bruintje
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mdmcq5Author Commented:
Ok, it's actually a picture containing a picture of a button and the whole page is linked to an "Action Setting" where the .exe is set under Mouse Click -> Run Program -> launch.exe
0
mdmcq5Author Commented:
So, any additional input? was lowering the security the only option since the .exe was attached to a picture?
0
bruintjeCommented:
yes it really shouldn't make a difference where the macro was attached to, that warning comes only from opening a file that contains a macro
0
mdmcq5Author Commented:
The file being opened is an .exe file, and that is why the warning message is appearing.  There is no macro.  Is there something other than lowering the security on powerpoint, to stop the warning from appearing when attempting to launch the application attached to the powerpoint slide?  Macro coding?
0
asian_niceguyCommented:
the actual linking of the executable file is a powerpoint macro in itself. so in this case you must lower the security to prevent pop up warning essages occuring.
0
mdmcq5Author Commented:
So, basically as I've said....What I did was the only option....I was referring more to adding coding into a macro to stop the pop-up; that's not an option or resolution?

Let's stop repeating ourselves, please....
0
mdmcq5Author Commented:
according to everyone so far my original solution to my own question was the only option; unless someone else can chime in now..
My last resort has been to set my security to "LOW" temporarily when I want to run PowerPoint presentations; which is very frequent.  I'd rather add a macro w/the correct coding to have it run automatically.  Just in case I forget to change the security settings back.

Although, I answered my own question; I'm rewarding bruintje the points b/c he was more on target.  Even though this particular presentation does not contain any Command buttons for entering the End Sub commands to stop the pop ups.  Closing question this way is much quicker than waiting four days for admins to; especially when making the request counts towards your question count ->
>> When I click to play the file the usual warning message pops up:
>> Some files can contain viruses..yada yada yada....Would you like to open this file? um, yes...

that warning only pops up when opening the powerpoint file not when running the code behind the button on button click so you do not need any additional code, turning off the security warnings under macro | security was enough

here is a sample ppt file containing that code which is familair ;-)

source: http://www.traktiq.net/ee_temp/ppt_21781745.ppt
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.