Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run PPT code from excel
I am trying to run the following code but get this error message:
Run-Time error '429': ActiveX component can't create object I have referenced the Microsoft PowerPoint 11.0 Object Library Sub ChangeUpdateMode() Dim objPPT As Object Set objPPT = CreateObject("Powerpoint.application") objPPT.Visible = True objPPT.Presentations.Open ThisWorkbook.Path & "\Template.ppt" Dim sld As Slide Dim sh As Shape For Each sld In ActivePresentation.Slides 'THIS LINE CAUSES ERROR For Each sh In sld.Shapes If sh.Type = msoLinkedOLEObject Then ' Set the link to manual update mode sh.LinkFormat.AutoUpdate = ppUpdateOptionManual End If Next sh Next sld Set objPPT = Nothing End Sub I also get the same error if I try to open PPT using this line of code from Excel VBA: PowerPoint.Application.Presentations.Open strOpenPath Does anyone have any suggestions on how I can avoid this? Thanks! Dan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run PPT code from excel
Dan,
I would try always fully qualifying the objects: For Each sld In ActivePresentation.Slides should be: For Each sld In objPPT.ActivePresentation.Slides HTH, Bernie MS Excel MVP "Dan" wrote in message ... I am trying to run the following code but get this error message: Run-Time error '429': ActiveX component can't create object I have referenced the Microsoft PowerPoint 11.0 Object Library Sub ChangeUpdateMode() Dim objPPT As Object Set objPPT = CreateObject("Powerpoint.application") objPPT.Visible = True objPPT.Presentations.Open ThisWorkbook.Path & "\Template.ppt" Dim sld As Slide Dim sh As Shape For Each sld In ActivePresentation.Slides 'THIS LINE CAUSES ERROR For Each sh In sld.Shapes If sh.Type = msoLinkedOLEObject Then ' Set the link to manual update mode sh.LinkFormat.AutoUpdate = ppUpdateOptionManual End If Next sh Next sld Set objPPT = Nothing End Sub I also get the same error if I try to open PPT using this line of code from Excel VBA: PowerPoint.Application.Presentations.Open strOpenPath Does anyone have any suggestions on how I can avoid this? Thanks! Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Word VBA Code to Excel Code | Excel Programming | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming | |||
Excel XP VBA code to search all macro code in Excel module for specific search string criteria | Excel Programming |