bbrimberry
New Member
- Joined
- Mar 23, 2016
- Messages
- 34
hello all,
I am trying to loop through all ppt textboxes in the active pres and write the data to excel
here's the code.. currently it's throwing a class not registered error.
would appreciate any help.
thanks!
Dim ppapp As PowerPoint.Application
Dim pppres As PowerPoint.Presentation
Sub getshapedata()
'On Error GoTo line1
Set ppapp = GetObject(, "Powerpoint.application")
Set pppres = ppapp.ActivePresentation
Dim shapeslide
Dim shapename
Dim shapetext
Dim nextrow
Dim currentSlide As Slide
Dim shp As Shape
For Each currentSlide In ActivePresentation.Slides
For Each shp In currentSlide.Shapes
' Check if the shape type is msoTextBox
If shp.Type = 17 Then
shapeslide = currentSlide.SlideIndex
shapename = shp.Name
shapetext = shp.TextEffect
nextrow = Sheet1.Range("a" & Rows.Count).End(xlUp).Row + 1
Sheet1.Range("a" & nextrow) = shapeslide
Sheet1.Range("b" & nextrow) = shapename
Sheet1.Range("c" & nextrow) = shapetext
End If
Next shp
Next currentSlide
End Sub
I am trying to loop through all ppt textboxes in the active pres and write the data to excel
here's the code.. currently it's throwing a class not registered error.
would appreciate any help.
thanks!
Dim ppapp As PowerPoint.Application
Dim pppres As PowerPoint.Presentation
Sub getshapedata()
'On Error GoTo line1
Set ppapp = GetObject(, "Powerpoint.application")
Set pppres = ppapp.ActivePresentation
Dim shapeslide
Dim shapename
Dim shapetext
Dim nextrow
Dim currentSlide As Slide
Dim shp As Shape
For Each currentSlide In ActivePresentation.Slides
For Each shp In currentSlide.Shapes
' Check if the shape type is msoTextBox
If shp.Type = 17 Then
shapeslide = currentSlide.SlideIndex
shapename = shp.Name
shapetext = shp.TextEffect
nextrow = Sheet1.Range("a" & Rows.Count).End(xlUp).Row + 1
Sheet1.Range("a" & nextrow) = shapeslide
Sheet1.Range("b" & nextrow) = shapename
Sheet1.Range("c" & nextrow) = shapetext
End If
Next shp
Next currentSlide
End Sub