How to delete CommandButton and coding

Sumeluar

Board Regular
Joined
Jun 21, 2006
Messages
245
Greetings!

I have a template which uses a CommandButton to get my form copied, saved and printed and in turn automatically closes everything, It works just beautifull, Only problem is that the freshly copied sheet brings with it, the coding and the CommandButton and a few other lines that I don't want them to appear because other users are to have acces to it and mishandling is occuring in the sense of altering the form and it also looks ugly.

Is there an easy way to delete all the above before the new copy is made?

Regards!

Sumeluar
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
try this suggestison


From: Erik Dillenkofer - view profile
Date: Mon, Jul 28 1997 12:00 am
Email: Erik Dillenkofer <esd...@NOSPAMgate.net>
Groups: microsoft.public.excel.programming


> RE: xlVeryHidden modules

> A macro cannot VeryHide the module in which it resides. This is a feature of Excel, apparently designed for extra protection. If a macro calls a subroutine in another module, it will also be unable to hide that module.

> The only way to very hide all the modules in a workbook is to write a
> temporary module with the code:

> Sub HideModules()
> For each m in Modules
> If m.Name <> Activesheet.Name Then m.Visible = xlVeryHidden
> Next
> End Sub

> Make sure this module is the active sheet, then run the macro and delete it. Remember to protect your workbook, otherwise users can write their own macro to unhide all of yours.


reference:
http://groups.google.com/group/micr...lnk=st&q=hide+modules&rnum=1#2fcbb678df40a02e
 

Sumeluar

Board Regular
Joined
Jun 21, 2006
Messages
245
Thanks venkat1926, Looking forward to give it a try.

Regards!
 

Forum statistics

Threads
1,136,266
Messages
5,674,728
Members
419,523
Latest member
Urnovio

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