remove all code and objects

kevster

New Member
Joined
Nov 16, 2005
Messages
42
Hi all

I want to be able to copy sheets from my master file to another file twice a week. each sheet as command buttons on it link to code. when i copy the sheets i want to be able to remove all objects and any associated code so when i email the new file it wont ask the user at the other end if he/she wants to enable macros. do i ahve to delete each object seperate or is there a way to remove or objects in on go.

any help appreciated
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
kevster.

do i ahve to delete each object seperate or is there a way to remove or objects in on go.

Code:
ActiveSheet.DrawingObjects.Delete
removes all objects in one go.

to remove code, see chip pearson's explanation for working with the VBE here.

cheers. ben.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

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