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
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,197
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.
 

paultrins

New Member
Joined
Mar 19, 2010
Messages
2
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:

Forum statistics

Threads
1,082,478
Messages
5,365,788
Members
400,850
Latest member
Raj_Jpr

Some videos you may like

This Week's Hot Topics

Top