Google Answers Logo
View Question
 
Q: Running Visual Basic from PowerPower Presentation ( No Answer,   4 Comments )
Question  
Subject: Running Visual Basic from PowerPower Presentation
Category: Computers > Programming
Asked by: skippy60-ga
List Price: $5.00
Posted: 07 Apr 2004 14:31 PDT
Expires: 07 May 2004 14:31 PDT
Question ID: 326800
I have a PowerPoint 2003 Presentation that runs a VB 6 program. The
link was set up by using the Slide Show/Action Settings/Run Program
insert. With the Browse button, I can locate the desired program,
which runs great when viewing the slide show.

But there is a problem. If I shut down PowerPoint and start again some
time later, the next time I try to run the slide show, the link comes
up with file not found. This occurs even though the link label still
points to the correct program file name.

I can repeat the Slide Show/Action Settings/Run Program insert and get
it work again, but then it fails after shutting down and restarting
later.

Anybody got a solution here? All I'm trying to do is run a VB program
from a PowerPoint presentation.

Request for Question Clarification by mathtalk-ga on 07 Apr 2004 17:53 PDT
Is the pathname to the executable fully qualified?  It sounds like an
issue with "where's the current directory" and relative pathnames.

Just a thought...

-- mathtalk-ga

Clarification of Question by skippy60-ga on 07 Apr 2004 19:54 PDT
Yes, when you use the browse button to locate the program, it does
produce a complete path name starting with
c:\directory1\directory2\directorty3\filename.

Nice try, but the problem lies elsewhere. The strange thing is that a
label does appear on later tries that shows the complete path name,
and yet PP pops up a cannot find error. Totally illogical.

Request for Question Clarification by mathtalk-ga on 07 Apr 2004 23:39 PDT
How about embedded spaces in the path?  Maybe some quotation marks
around the executable filename, as they would appear in a "shortcut"?

-- mathtalk-ga

Clarification of Question by skippy60-ga on 08 Apr 2004 09:32 PDT
mathtalk,

I trield quotation marks, but it did not work.

I did find out something new, however. The program I am calling has to
load two other files that are in the same directory.

Because of the above, I wrote a simple "Hello World" program with no
called files. This clears the problem. Apparently, it is the files
being called that cannot be found.

Since the files being called are in the same directory as the program,
it seems strange that PowerPoint cannot locate the called-for files.

Skip
Answer  
There is no answer at this time.

Comments  
Subject: Re: Running Visual Basic from PowerPower Presentation
From: donessive-ga on 08 Apr 2004 10:59 PDT
 
The problem you are experiencing is that the default path when
PowerPoint is started up is the PowerPoint path - not your VB
application's location path.  I was able to reproduce your error by
trying to load files from with VB.

What you need to do is one of these two options:

1) Recompile the VB app to point to the full path to the extra files
reference - like 'c:\myvbapp\controlfiles\file.txt' rather than just
'file.txt'.

or, if you can't change the VB app:

2) Create a new shortcut to PowerPoint.  Right-click on the shortcut
and choose properties.  In the line called 'Start in:' - put in the
path of your VB application.  Press Apply.  This will fix your problem
as long as all files referenced in the VB app are in the same
directory.

I tested both and that fixed your problem.

Hope that helps!
Subject: Re: Running Visual Basic from PowerPower Presentation
From: trym-ga on 08 Apr 2004 13:11 PDT
 
Hi again Skippy!
Do almost the same as with your word question.
Add a microsoft powerpoint (version) object reference and let your code
be something like:

        Dim appPP As PowerPoint.Application
        Dim PPDoc As PowerPoint.Presentation

        Dim strFileName As String
        strFileName = "c:\test.ppt"
        appPP = New PowerPoint.Application
        appPP.Activate()
        PPDoc = appPP.Presentations.Open(strFileName)
        PPDoc.SlideShowSettings.Run() ' If you want the slide show to start

Hope this helps you.

-Trym
Subject: Re: Running Visual Basic from PowerPower Presentation
From: trym-ga on 08 Apr 2004 13:13 PDT
 
Haha skippy, I think I read this one too fast.
I'll see if I can find a solution, if you haven't already
Subject: Re: Running Visual Basic from PowerPower Presentation
From: trym-ga on 08 Apr 2004 13:18 PDT
 
Harr harr.
Im tired. Going to bed. Disregard everything I wrote.

;)
-Trym

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy