ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   removing acontrol from the toolbar (https://www.excelbanter.com/excel-programming/353850-removing-acontrol-toolbar.html)

Joe

removing acontrol from the toolbar
 
Thanks kevin for your quick replay, how can I remove it then when I close the
workbook, so that I wouldn't find this button on other worksheets?

Jim Thomlinson[_5_]

removing acontrol from the toolbar
 
Application.CommandBars("Worksheet Menu Bar").Controls("MyControl").Delete

--
HTH...

Jim Thomlinson


"joe" wrote:

Thanks kevin for your quick replay, how can I remove it then when I close the
workbook, so that I wouldn't find this button on other worksheets?


Jim Thomlinson[_5_]

removing acontrol from the toolbar
 
You probably want to (if I understand the post correctly) want to add code to
the thisworkbook module to react to the Workbook Open / Workbook Activate
events to create the command button and to the Workbook Close / Workbook
Deactivate... If you want help with that just let me know...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Application.CommandBars("Worksheet Menu Bar").Controls("MyControl").Delete

--
HTH...

Jim Thomlinson


"joe" wrote:

Thanks kevin for your quick replay, how can I remove it then when I close the
workbook, so that I wouldn't find this button on other worksheets?


Joe

removing acontrol from the toolbar
 
Got me! Yes thats what I wanted to do.
I put the code in the thisworkbook_open and Deactivate events
1. I now can add a menu item in the menu bar, but not on the toolbar
2. I can't remove the items added

Need your help on this

"Jim Thomlinson" wrote:

You probably want to (if I understand the post correctly) want to add code to
the thisworkbook module to react to the Workbook Open / Workbook Activate
events to create the command button and to the Workbook Close / Workbook
Deactivate... If you want help with that just let me know...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Application.CommandBars("Worksheet Menu Bar").Controls("MyControl").Delete

--
HTH...

Jim Thomlinson


"joe" wrote:

Thanks kevin for your quick replay, how can I remove it then when I close the
workbook, so that I wouldn't find this button on other worksheets?


Jim Thomlinson[_5_]

removing acontrol from the toolbar
 
Sorry about taking so long to get back to you. What you want to do is to
create a sub procedure to add the control and one to remove the control. Once
they are perfected then you can then just call these procedures from the
appropriate events. The other trick is that you want to have all of the
appropriate error handling to take care of any errors in your cdoe. Wtihout
error handling, the controls are bound to get stuck at some point when an
error occures. This is a fairly big project but if you take it one step at a
time it is not too bad to do. If you are still around and need more help post
a new thread and include some code with it.
--
HTH...

Jim Thomlinson


"joe" wrote:

Got me! Yes thats what I wanted to do.
I put the code in the thisworkbook_open and Deactivate events
1. I now can add a menu item in the menu bar, but not on the toolbar
2. I can't remove the items added

Need your help on this

"Jim Thomlinson" wrote:

You probably want to (if I understand the post correctly) want to add code to
the thisworkbook module to react to the Workbook Open / Workbook Activate
events to create the command button and to the Workbook Close / Workbook
Deactivate... If you want help with that just let me know...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Application.CommandBars("Worksheet Menu Bar").Controls("MyControl").Delete

--
HTH...

Jim Thomlinson


"joe" wrote:

Thanks kevin for your quick replay, how can I remove it then when I close the
workbook, so that I wouldn't find this button on other worksheets?



All times are GMT +1. The time now is 11:04 PM.

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