View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Hiding/Restoring Built-In CommandBars?

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


"Jason Paris" wrote:

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