Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > Open PPT from Excel


Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2003, 12:54 PM
Klynn Klynn is offline
Newcomer
 
Join Date: Oct 2003
Posts: 4
Default Open PPT from Excel


I have an existing presentation in Power Point that I would like to launch from excel. When I try to code...ppt is an invalid file type.

Is there a way to launch powerpoint from excel??

I would like to open x:\data\listing.xls, then open my power point presentation X:\data\CarShow.ppt by clicking on a button within excel.


Thanks in advance.
Reply With Quote
  #2  
Old 10-22-2003, 01:42 PM
ajc ajc is offline
Regular
 
Join Date: Oct 2003
Location: Dublin, Ireland
Posts: 75
Default

Attach the following code to your button in Excel :
Code:
Sub LaunchPPT() Dim ppt As Object Set ppt = CreateObject("PowerPoint.Application") ppt.Visible = True ppt.Presentations.Open "X:\data\CarShow.ppt" Set ppt = Nothing End Sub

Regards,
Reply With Quote
  #3  
Old 10-22-2003, 01:57 PM
Klynn Klynn is offline
Newcomer
 
Join Date: Oct 2003
Posts: 4
Default

Thank you so much for your help. The code worked perfectly.

I hope I am not pushing my luck, is there anyway once the ppt is open to automatically run the update link option? If not, that’s ok. You have helped me out more than you can imagine.

Thanks again.
Reply With Quote
  #4  
Old 10-22-2003, 02:20 PM
ajc ajc is offline
Regular
 
Join Date: Oct 2003
Location: Dublin, Ireland
Posts: 75
Default

Don't worry about pushing your luck, but as I do not do much with Powerpoint perhaps another will suggest an answer.

In the meantime, is it possible for to set up the links in powerpoint so that they auto update when the document is opened.

Cheers
Reply With Quote
  #5  
Old 10-22-2003, 03:03 PM
tboltfrank tboltfrank is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,022
Default

I know almost nothing about powerpoint, but by looking in PowerPoints VBA help, it looks like you could insert a new Class module and place this code there. - I did so and my test presentation opened without any error for me; but you would have to actualy set up a link and test it that way, to see if it actualy will do the job.
Code:
Private Sub App_PresentationOpen(ByVal Pres As Presentation) With Pres .UpdateLinks ' or just this one line ActivePresentation.UpdateLinks End With End Sub
Hope it works

Edit: I found this by typing "event" in the help search in the VB editor.
I saw one that said something like open event. I read there that it needs to be in a class module. So I inserted a new Class Module and copied and pasted the relivant part of the code there. - Then I typed in "Link" and there was a list of matches, one having to do with Updating Links: ActivePresentation.UpdateLinks

Last edited by tboltfrank; 10-22-2003 at 03:17 PM.
Reply With Quote
  #6  
Old 10-22-2003, 03:14 PM
ajc ajc is offline
Regular
 
Join Date: Oct 2003
Location: Dublin, Ireland
Posts: 75
Default

In view of tboltfrank's contribution perhaps the following might help :
Code:
Sub LaunchPPT() Dim ppt As Object Set ppt = CreateObject("PowerPoint.Application") With ppt .Visible = True .Presentations.Open "X:\data\CarShow.ppt" .ActivePresentation.UpdateLinks End With Set ppt = Nothing End Sub
Regards,
Reply With Quote
  #7  
Old 10-22-2003, 03:19 PM
tboltfrank tboltfrank is offline
Senior Contributor
 
Join Date: Jul 2003
Posts: 1,022
Default

I tried similar code to that, but not exactly that, so give it a shot.

I also looked in the regular help, and I don't think there is a setting to configure this in PowerPoint to happen without code. - I looked around in options too and saw nothing. Try it yourself though, incase I misunderstood.

Edit: Cool ajc - That successfully runs.(as you probably already knew. - Hopefully one of our ideas also successfully Udates the Links

Last edited by tboltfrank; 10-22-2003 at 03:34 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open an Excel file from Word Document Lina Excel 2 06-12-2003 02:38 PM
Beginner help with timers. School program... KreeZiE General 18 04-24-2003 04:45 PM
Makin a nice little program! Decontain Communications 3 04-11-2003 02:54 AM
open a new excel befuddled Word, PowerPoint, Outlook, and Other Office Products 4 08-02-2002 02:09 AM
howto get excel to open a file name that is listed in a textbox within my application Retroflexus General 3 06-28-2002 12:40 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->