L
lance-news
Hello,
I am trying to create a macro to add autoshapes to a spreadsheet in
powerpoint. Can anyone spot the problem. Keeps bombing out on this line:
ShapeObject.Shapes.AddShape(9, 40.5, 16.5, 22.5, 20.25).Select
Sub test()
Dim SlideObject As Slide
Dim ShapeObject As Shape
For Each SlideObject In Application.ActivePresentation.Slides
' Inner loop goes through every shape in the presentation
For Each ShapeObject In SlideObject.Shapes
' Check if the shape is an OLE object
If ShapeObject.Type = 7 Then
ShapeObject.Shapes.AddShape(9, 40.5, 16.5, 22.5, 20.25).Select
End If
Next ShapeObject
Next SlideObject
End Sub
I am trying to create a macro to add autoshapes to a spreadsheet in
powerpoint. Can anyone spot the problem. Keeps bombing out on this line:
ShapeObject.Shapes.AddShape(9, 40.5, 16.5, 22.5, 20.25).Select
Sub test()
Dim SlideObject As Slide
Dim ShapeObject As Shape
For Each SlideObject In Application.ActivePresentation.Slides
' Inner loop goes through every shape in the presentation
For Each ShapeObject In SlideObject.Shapes
' Check if the shape is an OLE object
If ShapeObject.Type = 7 Then
ShapeObject.Shapes.AddShape(9, 40.5, 16.5, 22.5, 20.25).Select
End If
Next ShapeObject
Next SlideObject
End Sub