My code works well if the worksheet name is Sheet1. It will change constantly. I have alot of other similar workbooks that are not affected and cannot figure this out. Here is the code that I get the error at:
Private Sub Test_Click()
Sheet18.Unprotect ("linux")
Dim Sh As Shape
With Worksheets("Sheet1")
For Each Sh In ActiveSheet.Shapes
If Not Application.Intersect(Sh.TopLeftCell, .Range("F36:AE45")) Is Nothing Then
If Sh.Type = msoPicture Then Sh.Delete
End If
Next Sh
End With
CoreFront.Show
Sheet18.Protect ("linux")
End Sub
The error is: Run-time error '9': Subscript out of range
Any suggestions? Thank You.
Bookmarks