Selection.Delete

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)
 
T

ToyRider

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top