Selection.Delete

  • Thread starter Thread starter ToyRider
  • Start date Start date
T

ToyRider

I recently jump over from office 2000 to office 2003.
Now I have the following problem with the following code :

Sheets("Schema_ (2)").Shapes("CommandButton3").Select
Selection.Delete

This is to remove a commandbutton which I do not need anymore after I haven
copied the worksheet.
It was working fine in excel 2000, but now it gives the error.
Can't enter break mode at this time, when i press continue than the next
error comes up: runtime error 13, type mismatch.

I've checked the error codes and the function for to delete this button, but
i can't find what is wrong in my code.

Please can anyone help me.

Thanks allready

Greetz

ToyRider(Netherlands)
 
Okay,
I solved the problem myself

Changed my code with:
Sheets("Schema_ (2)").Shapes("CommandButton3").Delete

And it's working now, Strange because I've tried this before and than it
didn't work.
But that was caused by some code in another sheet who revered to this
commandbutton. That was my error 13.

Hope someone else can use this information.

Greetz

ToyRider(Netherlands)
 
Back
Top