ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hide button from Template (https://www.excelbanter.com/excel-discussion-misc-queries/12275-hide-button-template.html)

Dennis

Hide button from Template
 
I have a macro linked to a command button on an excel template. I'd like to
have the button hidden (or deleted) on the new spreadsheet the user will save
to another name.

Dave Peterson

Not sure when you want the button deleted, but one way to delete it is:

Worksheets("sheet1").OLEObjects("CommandButton1"). Delete

Chip Pearson has some instructions on how to remove code (or add code) on the
fly.
http://www.cpearson.com/excel/vbe.htm

Have you thought of removing the code (and button) from your template and using
another workbook for the code (maybe even a nice toolbar floating over your
workbook).



Dennis wrote:

I have a macro linked to a command button on an excel template. I'd like to
have the button hidden (or deleted) on the new spreadsheet the user will save
to another name.


--

Dave Peterson


All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com