Hi all, I have a method in my macro that executes the following code:
Set myDocument = Worksheets("sheet1")
For each sh in myDocument.Shapes
If sh.Name = "square" Then
sh.Cut
End If
Next
My problem is that the code causes an error on the line sh.Cut. I know that there is a shape called "square" - I can see (visually) the shape in the document, but Excel just doesn't want to cut that shape out. Any suggestions as to why this might be?
EDIT: To clarify, this behaviour does not always happen. Usually it is alright - it only seems to happen sometimes, but I can't see any co-relation between the times that it happens.
Thanks.