Embedding and displaying a Powepoint slide presentation in an Excel Userform. Possible?

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
917
Office Version
  1. 365
Platform
  1. Windows
The title explains what I'm having difficulty doing. Is it possible to do this ?
I believe that I copied the Powerpoint file path correctly and it is
Code:
Set pptPres = pptApp.Presentations.Open("C:\Users\car19\OneDrive\Desktop\SHOULD WE  BELIEVE  IN THE RAPTURE LATEST\A SHOULD WE BELIEVE IN THE RAPTURE
The code block that follows I copied from CoPilot's chat GPT and is in the forms Initialize Event:
Code:
 Private Sub UserForm_Initialize()
    Dim pptApp As Object
    Dim pptPres As Object
    Dim pptSlide As Object
    ' Create a new instance of PowerPoint application
    Set pptApp = CreateObject("PowerPoint.Application")
    pptApp.Visible = True
Set pptPres = pptApp.Presentations.Open("C:\Users\car19\OneDrive\Desktop\SHOULD WE  BELIEVE  IN THE RAPTURE LATEST\A SHOULD WE BELIEVE IN THE RAPTURE ONE.pptx")
    ' Open the PowerPoint presentation
''    Set pptPres = pptApp.Presentations.Open("C:\path\to\your\presentation.pptx")
    ' Embed the PowerPoint presentation in the Object Frame
    Me.Frame1.Class = "PowerPoint.Slide"
    Set pptSlide = pptPres.Slides(1)
    Me.Frame1.Object = pptSlide
End Sub
Followed this instruction:
  1. Add an Object Frame:
    • In the UserForm, add an Object Frame control (also known as OLEObject).
    • This control will be used to embed the PowerPoint presentation.
I assumed an Object Frame is just a Frame control like Frame1. So I used that in the code and ran it. It didn't work.
I then tried using a Webrowser1 control in the code and ran that. It didn't work either.

run time error message both times is "Object doesn't support this property or method"
The Powerpoint workbook is on my hard drive, so its local, so I don't know why the suggestion for a Webrowser control, unless
a Webrowser control has portal functionality and can be used for other than accessing websites..

All I want to do is just display Powerpoint slides on an Excel userform and use navigation
buttons to advance from slide to slide.

If this can be done, why so difficult? Should be relatively straightforward.

Could anyone help me with this? Any help and guidance will be greatly appreciated.
Thanks, cr
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,872
Messages
6,175,104
Members
452,613
Latest member
amorehouse

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top