How to get the handler of an opened powerpoint presentation in Excel VBA

the_drug

I am trying to get the handler of a powerpoint presentation. Typically, I use the following instruction:

Set pres = PowerPoint.application.Presentations(pptFile)

I get the following error message:

'an activex component can't create object'

pptFile is supposed to be already open

Any Idea?

Steve Rindsberg

If you don't want to open the same presentation twice, something like this:

Dim pptFile As String
pptFile = "C:\Users\" & Environ$("username") & "\Desktop\ppp.pptx"

Dim pptApp As PowerPoint.Application
Set pptApp = New PowerPoint.Application

Dim pres As Presentation

For Each pres in pptApp.Presentations
   If pres.FullName = pptFile then
      ' found it!
      Exit For
   End If
End If

' And possibly do this to open the file if it's not already open
If pres Is Nothing Then
   Set pres = pptApp.Presentations.Open(pptFile)
End If

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get the handler of an opened powerpoint presentation in Excel VBA

From Dev

Generating a powerpoint presentation with VBA and Excel

From Dev

Open a PowerPoint presentation from Excel with VBA and then set that presentation to a variable

From Dev

Set PowerPoint presentation when already opened (From Excel)

From Dev

how to add a textbox to a powerpoint presentation using vba

From Dev

Powerpoint and VBA - "Modular" presentation

From Dev

Excel VBA Can't SaveAs Embedded PowerPoint Presentation in Office 2016

From Dev

Unable to open an existing PowerPoint Presentation (2016) from Excel using VBA

From Dev

in VBA powerpoint How to add a new slide to an empty presentation

From Dev

How to activate opened excel in VBA

From Dev

From Excel get the dimensions of a shape in PowerPoint with VBA

From Dev

VBA to list all object names of a powerpoint presentation

From Dev

From within Excel how do I change an active PowerPoint presentation without switching focus?

From Dev

How to add pictures to Powerpoint Presentation Picture PlaceHolder?

From Dev

Paperclip: How to upload Powerpoint presentation files

From Dev

How to have sub-points in a powerpoint presentation

From Dev

How to extract all images from a PowerPoint presentation?

From Dev

How to convert Powerpoint ppsx (presentation) to pdf?

From Dev

Paperclip: How to upload Powerpoint presentation files

From Dev

How can I get presenter view when recording my PowerPoint presentation?

From Dev

open particular slide of powerpoint presentation from access vba

From Dev

VBA powerpoint, run timed task/macro in background across presentation

From Dev

how to paste table from excel to powerpoint 2007 as default using vba

From Dev

How to modify text in Powerpoint via Excel VBA without changing style

From Dev

Using PowerPoint VBA to change from a Kiosk presentation type to a Speaker presentation type

From Dev

Excel VBA Duplicating a Slide in PowerPoint

From Dev

How to get position of image in PowerPoint from centimeters to points with VBA

From Dev

Setting the language of a Powerpoint presentation

From Dev

How to programmatically trigger presentation mode in JavaScript add-in for PowerPoint?

Related Related

  1. 1

    How to get the handler of an opened powerpoint presentation in Excel VBA

  2. 2

    Generating a powerpoint presentation with VBA and Excel

  3. 3

    Open a PowerPoint presentation from Excel with VBA and then set that presentation to a variable

  4. 4

    Set PowerPoint presentation when already opened (From Excel)

  5. 5

    how to add a textbox to a powerpoint presentation using vba

  6. 6

    Powerpoint and VBA - "Modular" presentation

  7. 7

    Excel VBA Can't SaveAs Embedded PowerPoint Presentation in Office 2016

  8. 8

    Unable to open an existing PowerPoint Presentation (2016) from Excel using VBA

  9. 9

    in VBA powerpoint How to add a new slide to an empty presentation

  10. 10

    How to activate opened excel in VBA

  11. 11

    From Excel get the dimensions of a shape in PowerPoint with VBA

  12. 12

    VBA to list all object names of a powerpoint presentation

  13. 13

    From within Excel how do I change an active PowerPoint presentation without switching focus?

  14. 14

    How to add pictures to Powerpoint Presentation Picture PlaceHolder?

  15. 15

    Paperclip: How to upload Powerpoint presentation files

  16. 16

    How to have sub-points in a powerpoint presentation

  17. 17

    How to extract all images from a PowerPoint presentation?

  18. 18

    How to convert Powerpoint ppsx (presentation) to pdf?

  19. 19

    Paperclip: How to upload Powerpoint presentation files

  20. 20

    How can I get presenter view when recording my PowerPoint presentation?

  21. 21

    open particular slide of powerpoint presentation from access vba

  22. 22

    VBA powerpoint, run timed task/macro in background across presentation

  23. 23

    how to paste table from excel to powerpoint 2007 as default using vba

  24. 24

    How to modify text in Powerpoint via Excel VBA without changing style

  25. 25

    Using PowerPoint VBA to change from a Kiosk presentation type to a Speaker presentation type

  26. 26

    Excel VBA Duplicating a Slide in PowerPoint

  27. 27

    How to get position of image in PowerPoint from centimeters to points with VBA

  28. 28

    Setting the language of a Powerpoint presentation

  29. 29

    How to programmatically trigger presentation mode in JavaScript add-in for PowerPoint?

HotTag

Archive