is it possible to disable commandbar attach?

Emjaye

Board Regular
Joined
Oct 3, 2003
Messages
89
Is it possible to disable the ability to "Attach" toolbars to a workbook?
I've a toolbar/commandbar created 'on the fly' when the workbook activates, (deleted on deactivate)...
Just curious to see if it is possible to stop it being attached to the workbook? I don't know how to disable this..

thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You coul dmake it start msofloating. But they could still drag it to the workbook wall. I don't think you can disable the attachability of it. You would probablly want to go with a user form for that. Out of curiousity...Why would would want to prevent it from docking?
 
Upvote 0
Thanks Oorang, but I haven't clarified it too well!

I don't mean to disable the "docking" or floating ability ... can do that by .msobarnocustomize.

I meant how to disable "saving" (attaching) a commandbar to a workbook when the workbook is saved

i.e. disable the path > View/Toolbars/Customize/('toolbars' tab) Attach/Copy

preferably for a specific commandbar rather than en-mass, with something I suspect, along the lines of a MSOBAR instruction?

thanks
 
Upvote 0
I meant how to disable "saving" (attaching) a commandbar to a workbook when the workbook is saved
Set ICB = Application.CommandBars.Add(Name:="iClear Console", Temporary:=True)
 
Upvote 0
Sorry, this isn't working for me.... (Using Excel XP and also 2003).
Other thoughts gratefully received.
 
Upvote 0
I think maybe I'm still not clear on what you are wanting. And what you mean be "attaching"
 
Upvote 0
Hi Oorang, apologies for the delay in coming back...

I am looking for something to apply to an individual, specified Commandbar ... in a similar fashion by which it is possible to prevent customisation of a single Commandbar by using the command:
Code:
 Application.Commandbars("MyBar").Protection = msoBarNoCustomize
However this does not prevent the User from accessing Standard (Excel) Customise menu, from which they can navigate and locate a 'custom' commandbar and then Attach (or effectively save) that commandbar with the workbook file; therefore, that "saved" commandbar loads everytime the workbook is opened, even when macro are disabled... this is my main motivation for preventing it from being possible.

I know it is possible to disable the customisation of all commandbars by applying the command:
Code:
Application.CommandBars.DisableCustomize = True
but I'm not too keen to do that, I will do so if needbe though :biggrin:

cheers, Mike
 
Upvote 0
Ahhhh!!!! Now I know EXACTLY what you are talkign about. When you create the code for your bar, use Temporary:=TRUE. Even if they attach the bar to the workbook, save and close. When you come back the bar will not be there.
 
Upvote 0

Forum statistics

Threads
1,206,949
Messages
6,075,811
Members
446,158
Latest member
octagonalowl

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