I inherited a project from another person and I need to modify it. There are a LOT (as in a LOT LOT LOT) of shapes on his excel spreadsheets that are linked to macros and I want to remove all of the macro links so I can manipulate the shapes. I tried the following loop but it crashed and burned at the highlighted line of code and gave the following error:
Run-time error '438':
Object doesn't support this property or method
Any ideas on how to do it?
-JTBorton
Another Day, Another Disaster
Run-time error '438':
Object doesn't support this property or method
Code:
Public Sub UnAssignAMacro()
Dim wkSht As Excel.Worksheet, objShape As Excel.Shape
For Each wkSht In Worksheets
[highlight]For Each objShape In wkSht[/highlight]
ActiveSheet.Shapes(objShape).OnAction = ""
Next objShape
Next wkSht
End Sub
Any ideas on how to do it?
-JTBorton
Another Day, Another Disaster