Macro command button gets Deleted

paultrins

New Member
Joined
Mar 19, 2010
Messages
2
I am new to this forum.
I have an excel file with macros.I group all the shapes on a sheet.The command button and check boxes also gets included in it.When I delete the shape group the command button gets deleted.I just want to delete the shape group without the button and check boxes
Any suggestions?
Excel 97-2003

Paul
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Did you create the controls from the Forms toolbar or the activex control toolbox.

And, what controls did you create? Command buttons, checkboxes, and what else.
 
Upvote 0
Thank you Tom for the reply
I created command buttons and check boxes from the forms tool box
The code works well in excel 2007.I saved the workbook as Excel 97-2003.When I open the file in another computer which has Excel 2003 it deletes the command button.


'' The following code selects the shapes and group them
myDocument.Select
myDocument.Shapes.SelectAll
Selection.Group.Name = "TriGroup1"

'' The following code deletes the group

myDocument.Shapes("TriGroup1").Delete

''The problem is when it deletes the shape it deletes the command buton and check box

'' Any suggestions ?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top