Google Answers Logo
View Question
Q: Customizing Excel Toolbars ( Answered,   0 Comments )
Subject: Customizing Excel Toolbars
Category: Computers > Programming
Asked by: ny_insomniac-ga
List Price: $20.00
Posted: 05 Feb 2004 10:57 PST
Expires: 06 Mar 2004 10:57 PST
Question ID: 303813
I wrote an Excel (2000) application that customizes the excel toolbar,
hides the formula bar, changes some settings, etc.  The problem is
that after using my application, and they want to use normal Excel,
Excel remembers my settings and the standard toolbars and formula bars
are hidden.

Is there a way to change the Excel settings without having them saved
as a default?  Or a different solution to my problem that will allow
users to use my app and Excel without having to reconfigure all the
Subject: Re: Customizing Excel Toolbars
Answered By: hammer-ga on 05 Feb 2004 11:23 PST
When you exit your application, you can run a routine that resets all
the Toolbars to their uncustomized state. The information below is
from an Excel FAQ and provides VBA to do this.

Excel 97/2000 Developer FAQ
I've made lots of changes to Excel's toolbars. How can I restore all
of these toolbars to their original state?

You can use the Customize dialog box and reset each one manually. Or,
run the subroutine listed below.

Sub ResetAllToolbars()
    For Each tb In CommandBars
        If tb.Type = msoBarTypeNormal Then
            If tb.BuiltIn Then tb.Reset
        End If
    Next tb
End Sub


Search terms:
excel toolbar restore custom

Good luck with your Excel project!

- Hammer

Request for Answer Clarification by ny_insomniac-ga on 05 Feb 2004 12:53 PST
Your answer addresses the toolbars, but my issue expands to a hidden
Formula Bar, some Tools-Options changes, etc.  Plus, if the user had
different toolbars than the built-in Excel settings, I would wipe them

Is there a way to tell Excel not to remember the settings I change?

Clarification of Answer by hammer-ga on 05 Feb 2004 13:14 PST
You can't tell Excel not to remember. You are responsible for undoing
whatever changes you make on the way out.

For the Formula Bar, you can check the current state on the way in,
save it in a global variable, then restore it to the original setting
on the way out. The same applies to the "other" settings. The exact
code depends on which settings these are.

As to the toolbars, if you are concerned that they were already
altered before you got there, your best bet is probably to hide all
existing toolbars and replace them with complete custom toolbars of
your own, rather than modifying the ones that are already there. Then,
you don't have to worry about messing up whatever customizations they
may have made. Just hide all the existing toolbars on the way in and,
on the way out, ditch your custom toolbars and show the original set.

- Hammer
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy