OLE Object VBA question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following IF statement

If TypeName(PPPres.Slides(i).Shapes(j).OLEFormat.Object) = "Chart" Then

end if

And I suspect it's failing when there are no OLE objects in the slide. How
do I check to see if there are any OLE objects?
 
Barb Reinhardt said:
I have the following IF statement

If TypeName(PPPres.Slides(i).Shapes(j).OLEFormat.Object) = "Chart" Then

end if

And I suspect it's failing when there are no OLE objects in the slide. How
do I check to see if there are any OLE objects?

Typename will tell you what type of variable you have but not what kind of
object you're pointing at.

' Look at each shape's .Type
If oSh.Type = msoEmbeddedOLEObject Then
' Look at its ProgID
debug.print oSh.OLEFormat.ProgID
End If
 
Back
Top