Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you try to run a Microsoft Visual Basic for Applications macro: "Excel was previously unable to load your toolbar customizations"


View products that this article applies to.

Symptoms

When you run Microsoft Excel 2002 or Microsoft Office Excel 2007, you may receive an error message that resembles the following error message:
Microsoft Excel has encountered a problem and needs to close.
After you receive the first error message, you may receive a second error message that resembles the following error message:
Excel was previously unable to load your toolbar customizations. Would you like to reset your toolbars to their default state?
If you click Yes, Excel opens. However, if you click No, the first error message reappears.

↑ Back to the top


Cause

This problem occurs if the following conditions are true:
  • You run a Microsoft Visual Basic for Applications macro.

    This Microsoft Visual Basic for Applications macro resembles the following line of code:
    CommandBars("Watch Window").Controls(1).Reset
    						
    The Microsoft Visual Basic for Applications macro causes Excel to reset a control on the Watch Window toolbar by using the Reset method.
  • You then exit and restart Excel.

↑ Back to the top


Workaround

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this problem, do not use the Reset method on the Watch Windows CommandBar object. If you are using a looping structure on the CommandBars collection, exclude the Watch Window toolbar. The following sample code demonstrates this.
For Each cmdBar in Application.CommandBars
   If cmdBar.Visible Then
      If cmdBar.Name <> "Watch Window" Then
         cmdBar.Controls(1).Reset
      End If
   End If
Next
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

In Excel 2002 and in Excel 2007, the Watch Window toolbar is a pane-style control that does not allow for customization. However, because the Watch Window is considered a toolbar (a CommandBar object in Visual Basic for Applications) and toolbars can be customized, it accepts the Visual Basic for Applications Reset method. If it is reset, Excel 2002 or Excel 2007 is unable to reload the toolbar.

NOTE: This problem does not occur with the Task Pane toolbar. If you try to reset one of its controls, it will return a run-time error.

↑ Back to the top


Keywords: KB288614, kbpending, kberrmsg, kbbug

↑ Back to the top

Article Info
Article ID : 288614
Revision : 3
Created on : 1/6/2007
Published on : 1/6/2007
Exists online : False
Views : 226