Hiding/Restoring Built-In CommandBars?

J

Jason Paris

Hi there,

I've been reading up on CommandBars, and haven't yet seen anything to
suggest how to *hide* a built-in CommandBar........and to restore it
later. Was wondering if some kind soul could offer some advice.....?

I'm creating an application in Excel. The application is to have its
own Menu Bar, with Menus and Commands specific to the application.
The idea is for this custom Bar to replace the built-in Bar.

But, before the application makes these changes to the user's
environment, I'd like it to "audit" the current state of the built-in
Bar, and restore it to that state when the application exits.

Thank you kindly.

Jason Paris
 
G

Guest

hi
this will hide/unhide the custom command bar. it is boolen. you can assign
it to a custom icon but DON'T put the custom icon on the command bar that you
are trying to hide/unhide.
Sub CTB()
If Application.CommandBars("Custom 1").Visible = True Then
Application.CommandBars("Custom 1").Visible = False
Else
Application.CommandBars("Custom 1").Visible = True
End If
End Sub

custom menus:
I would keep the standard menu and just add to it. this keeps some kind of
familiarity to the application setup and avoids confusing the users too much.
understand:
1. custom command bars and menus apply ONLY to the pc being custiomized NOT
the file. you will have to customize each pc that will be using the custom
bars and menus so it might be wise to record/write a macro to do the
customizations.
2. you can put the customization macro in the file to run at file open and
hide at file close. see item 3 and 4 below. better yet...understand items 3
and 4 below.
3. be careful and not screw up any customizations the users may already have
on their pc. this tends to tick users off when they have to re-setup their pc
after you are done jerking their pc around.
4. be sure the users know that their pc will be customized BEFORE you start
adding/deleting/restoring their setup. have meetings and explain ie no
supprises.

regards
FSt1
 
J

Jason Paris

Hi FSt1,

Thanks for the advice.

Your code seems to hide a *custom* Menu Bar. Is there a way to hide/
restore the built-in Menu Bar, and replace it with a custom one?

Or is it more a case of removing the *Menus* from the built-in Bar,
and replacing them custom Menus?

If that *is* the case, how does one keep track of the Menus that were
on the Bar before the removal, so that they can be restored as the
application exits? I suspect there's a generic "Restore Built-in Bar"
method somewhere?

Many thanks. :)

Jason Paris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top