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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

sweater_vests_rock

Well-known Member
Joined
Oct 8, 2004
Messages
1,657
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.
 

Forum statistics

Threads
1,141,847
Messages
5,708,959
Members
421,601
Latest member
Garlo

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
Top