Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include executable file 2

Status
Not open for further replies.

sept2006

Technical User
Sep 6, 2006
42
CA
Hello,

I would like to insert an executable file (.exe)in a powerpoint presentation. this is a demonstration of a concept.
Is this insertion possible?
thanks.
 
Not sure about opening the .exe itself to be run from within PowerPoint, but you could certainly link to the folder it resides in and open the exe that way.

Here's how:
[ul]
[li]Insert a bitmap of your software's logo.[/li]
[li]Right click it and select Hyperlink.[/li]
[li]Browse to the location of your exe.[/li]
[li]Click OK.[/li]
[/ul]

It is important that either the exe is installed on the machine that is running the show, or that you have access to the folder it is installed on if on a network. You will receive a warning when launching your program that, "Some files can contain viruses...blah, blah, blah..." OK this an your file should launch. Upon exiting your program, you should be back to the running PowerPoint presentatin.

Hope this helps.

Tom

Born once die twice; born twice die once.
 
What do you mean "insert an executable file (.exe)"? I don't understand what that means.

Does it mean insert something that will RUN an executable?

If so, you can insert a commandbutton onto a slide, and use Shell. Something like:
Code:
Private Sub CommandButton1_Click()
Dim RetVal
RetVal = Shell("C:\Program Files\Polybytes\PolyView\Program\polyview.exe")
End Sub
When the button is clicked it would execute polyview.exe.

Gerry
My paintings and sculpture
 
Thanks ThomasLafferty and fumei.

I did not know how to use a shell, so I tried ThomasLafferty's suggestion.

It works but I have to add instructions on the powerPoint presentation (right click, choose open hyperlink).
it would have been nicer to be able to click a title or a button and run the animation.

thanks again.
 
Hi! So when your **show is running**, you can't just left click the logo and have it run?

Also, if you want, you could put a text box or title object on your slide, type something like Demonstration of Concept and click insert hyperlink, browse to your exe, etc. Then when your show is running, all you need to do is click your text based title. You could do the same thing with an action button.

Tom

Born once die twice; born twice die once.
 
it would have been nicer to be able to click a title or a button and run the animation.
This is precisely what I suggested.

1. If you do not have the Control toolbar visible, go View > Toolbars and select Control Toolbox.

2. Click the CommandButton icon on the Control Toolbox.

3. Draw the button on the slide.

4. Right click the button and select Properties.

5. Click on "Caption" in the left column of Properties. Type in whatever text you want to have on the button. "Run Animation"? Whatever.

6. Close Properties using the X on the top right.

7. Right click again and select View Code. This opens the Visual Basic Editor.

8. It will default to creating a procedure CommandButton_Click - which is exactly what you want. Put in the code I supplied, changing the path and name of the .exe to YOUR executable.

9. Close the Visual Basic Editor by clicking the close X at the top right.

10. Click anywhere on the slide to take focus from the commandbutton.

Done. The button will run your executable by clicking it. Shell is simply the internal command to run executables. There is not much to using it.



Gerry
My paintings and sculpture
 
I followed all the steps and put the following code as an example:

Private Sub CommandButton1_Click()
Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE")
End Sub

when I click the button, nothing happens. it is just selected as an image is when it is clicked on. I saved my presentation and re-opened it, but it did not make the button work.

any suggestions?
thanks.
 
This does not work in design mode - run slide show.

combo
 
That is correct. The button works when you are running the slide.

Further, as you are firing winword.exe, all this will do is open an instance of Word. It will be hidden, as PowerPoint will still have focus. Further again, it will not open Word with a document - just plain Word.

Perhaps if you actually explained what it is you want to do, it may help.

You say you want to run an animation. Well, just starting Word doesn't sound like that. The button WILL fire the .exe (WINWORD.EXE), but it will not DO anything else. This is because you are not giving any instruction about a specific document. Besides, what does Word have do with running an animation.

Perhaps again if you state exactly what it is you want to happen it may help.

Gerry
My paintings and sculpture
 
thank you so much for taking the time to answer.

the actual path I put in the button is: D:\Presentation\Animation11\pAi1.exe

the button does not work when clicked on but it does with the hyperlink method.
however, sometimes it is minimized and I have to stop running the presentation and maximize the application (pAi1.exe)!
I have to send this presentation away. I am afraid users will not know what to do in this case.
it is not user friendly, this is what I mean.

thanks again.

 
I'm sorry, but something is not right here.

If what you put in was - D:\Presentation\Animation11\pAi1.exe, then why did you say
I followed all the steps and put the following code as an example:

Private Sub CommandButton1_Click()
Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE")
End Sub
You DID say that was what you put in. Then when I ask about this, you say you put in - D:\Presentation\Animation11\pAi1.exe


It is helpful to state what you are actually doing. I have no idea why you would say you put in WINWORD.EXE, when you did not.

If pAi1.exe is an properly functioning executable, then Shell will properly execute it with a commandbutton. You write:
the button does not work when clicked on
but what does that mean? "Does not work" can mean:

1. It did nothing at all; OR
2. It did not work the way I want it to, or expect it to.

Which is it? "Does not work" is not a helpful phrase without actually telling us what it means.

Did you look up Shell in Help? There are other parameters to give it focus and/or maximized. You should also maybe look up WithEvents.

Even more helpful would be if you actually showed us what you are doing - that is....post your code.

In any case, using Shell with a commandbutton DOES work with executables (.exe). It may not be working the way you expect, but we can't really help if you do not explicitly state what you are doing. Post your code.

Gerry
My paintings and sculpture
 
I am sorry.

this is my actual code:

Private Sub CommandButton1_Click()
Dim RetVal
RetVal = Shell("D:\Presentation\Animation11\pAi1.exe")
End Sub

when it did not work, I tried to open word as a simple try.

''it did not work'' meant, for me, it did not do anything.

what I am exactly doing is developing a physics course. I was all excited to find a simulation of an experiment that could illustrate the concept in the classroom right next to the theory.

thanks again.
 
So what the heck is pAi1.exe????

When you click the commandbutton - and again it will only work DURING the slide show, NOT in design mode - you say nothing happens.

So, you start the slide show.
You have the slide with the button.
You click the button.
Nothing happens.

Question: if you Alt-Tab, does pAi1 does as a running task?

Gerry
My paintings and sculpture
 
Hi there!
A few thoughts:
This line:
Code:
RetVal = Shell("D:\Presentation\Animation11\pAi1.exe")
will attempt to launch whatever [!]pAi1.exe[/!]is from the [!]Animation11[/!] folder. This will only work IF:
1. The slide show is running
2. You have a command button named CommandButton1
3. The procedure name matches the control name.
4. pAi1.exe is in the path you specified


Here's how to fid out item 3:[ul][li]View your slide in Normal View(show not running)[/li][li]Right click your button and click Properties[/li]
[li]Confirm that the name is CommandButton1[/li][/ul]

By this
when it did not work, I tried to open word as a simple try.
I take it that you tried to open your executable from Word - not that you were trying to launch Word from your command button.

From this:
It works but I have to add instructions on the powerPoint presentation (right click, choose open hyperlink).
it would have been nicer to be able to click a title or a button and run the [!]animation[/!].
and from the fact that the exe is in a folder named Animation11, it makes me wonder what sort of object the "executable" is. Is it a movie/animation of some sort, or in fact an executable program file? If it is a movie/animation, then do this:
Insert==>Movies and Sounds==>Movie from file==>Browse to your file

Hope this helps.

Tom



Born once die twice; born twice die once.
 
Gerry - I think you are right on target on this. I had not yet seen your latest post (I think you are in a different time zone than me) when I started composing. I also have been pulled away a bit by my job (imagine that[smile], so I don't always see the full thread until after I submit and then check back. In any case, I think you're spot on.

Tom

Born once die twice; born twice die once.
 
Another very important point, as Tom states, the executable MUST be in the path/folder the instruction states it is in.

So if part of what you are trying to do is send the presentation to someone, then that .exe MUST be in the stated path.

But really....what the heck is pAi1.exe???

Gerry
My paintings and sculpture
 
thank a lot.

pAi1.exe illustrates the relationship between speed and acceleration. when run, one can see on the screen moving colored dots on graphs...

eventually, one of my colleagues is going to chip in and make specific animations with director, flash... in any case, executable files will be run from powerpoint.

pAi1.exe is a kind of a practise exercise. i do not know if i can distribute it. it came with one of my physics books.

Back to my problem: I can't open neither pAi1.exe nor microsoft word from my presentation (again, it is a way for me to figure out what does not work.)

i tried everything you suggested.
1001 thanks.
 
Is it possible for you to embed it as an object in PowerPoint?

1. Insert>Object>Create From File>Browse>Display as Icon>OK
2. Right Click>Action Settings>Object Action>Activate Contents
3. Run the show.
4. OK any warnings.

Maybe this will do it. (You will receive warnings about possible unsafe files/actions...)

Tom

Born once die twice; born twice die once.
 
I do not understand this. It would also help if you answered direct questions.

So, to repeat one: if you click the button WHILE displaying the slide show....if you Alt-Tab, does pAi1 does show as a running task?

If you use WINWORD.EXE (assuming the use of the proper path) does Word show in the taskbar. Can you see it at all?

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top