LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Creating new Powerpoint object and opening

There are several threads about opening a powerpoint presentation from an
Excel macro, and my syntax seems to follow these. However the code below
(which is just the start of the macro) works if the presentation is already
open in powerpoint but fails with the message

Presentations (unknown member) : Invalid request. The PowerPoint Frame
window does not exist.

at the line marked with '***** if there is no powerpoint application open.

Very grateful if anyone can point out where I'm going wrong. I'm using
Office 2000 and Windows XP Pro SP2.

CODE:

Dim oPPTApp As PowerPoint.Application
Dim oPPTShape As PowerPoint.Shape
Dim oPPTFile As PowerPoint.Presentation
Dim SlideNum As Integer
Sub Extract_slide_title_list()
Dim ppt_file As Variant
ppt_file = Application.GetOpenFilename("Powerpoint files (*.ppt),*.ppt",
, "Select Powerpoint file")
If ppt_file = False Then
Debug.Print "No file name entered. Programme exiting..."
response = MsgBox("No file name entered. Programme exiting...",
vbExclamation, "Warning")
End
End If

'Look for existing instance of Powerpoint
On Error Resume Next
Set oPPTApp = GetObject(, "PowerPoint.Application")
Set oPPTFile = oPPTApp.Presentations(ppt_file)
On Error GoTo 0
'Create new instance if no instance exists
If oPPTApp Is Nothing Then
Set oPPTApp = CreateObject("PowerPoint.Application")
Set oPPTFile = oPPTApp.Presentations.Open(ppt_file) '**********
End If
oPPTApp.Visible = msoTrue


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste object from excel to powerpoint Aaron Excel Programming 5 February 6th 08 04:13 PM
Chart to PPT without opening PowerPoint Abdul[_2_] Excel Programming 2 November 9th 06 01:06 AM
VB script in Excel object in Powerpoint (Urgent) epak Excel Discussion (Misc queries) 1 March 24th 06 05:04 PM
Creating a Powerpoint object (in XP onwards) with an ActiveWindow BizMark Excel Discussion (Misc queries) 0 August 12th 05 12:46 PM
Importing Excel Object in Powerpoint technically challanged Excel Discussion (Misc queries) 0 January 31st 05 09:25 PM


All times are GMT +1. The time now is 12:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"