View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Why can't I delete this shape now?

I have been using the following code to delete a shape for the the past
several years.

Option Explicit

Sub ClearPicture()

'DELETE IMAGE MKTPKG

Dim X As Shape

On Error Resume Next

Set X = Sheets("MktPkg").Shapes(1)

If Err = 0 Then

X.Delete

End If

End Sub



In fact, it still works on one version of my software, but on the other it
mysteriously stopped working. The shape gets pasted to the worksheet just
fine, but now, for some reason, it won't delete. I've tried cleaning my code
with Rob Bovey's code cleaner, but it still doesn't execute. When I remove
the On Error Resume Next, the message says Application-defined or
application-defined error.



What happened? Even for all the changes I've been making to the program, I
never touched this.



Please help if you can. Thank you.



Jim Kobzeff