Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jan 2005
    Thanked 0 Times in 0 Posts

    Disappeared custum toolbar (english/Excel 2000/V1)

    In a VBA application I created a custum user toolbar. Everything works fine. After closing the application, the custum toolbar is deleted and the Excel toolbars pops up again. I changed the macro in the way that for a certain 2nd toolbar to show up, the first one was disabled hoping it was still visible on top (I used the enabled false property), but...the toolbar disappeared and doesn't show up whenever I run the application again, not even after restarting Excel or restart the PC.
    When the add toolbar command is reached, the program jumps out of the subroutine without making/showing the toolbar.
    The toolbar isn't even found in the Excels toolbars custimization.
    What's going on? How can I solve this?

    many thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Disappeared custum toolbar (english/Excel 2000/V1)

    Welcome to Woody's Lounge.

    If a toolbar is disabled, it doesn't show in the list of available toolbars. You must use code to enable the toolbar again:

    Application.CommandBars("NameOfCustomToolbar").Ena bled = True

    If you want the toolbar visible, but disabled, you will have to disable all controls on the toolbar in a loop:

    Sub ToggleControls(ToolbarName As String, f As Boolean)
    Dim ctl As CommandBarControl
    For Each ctl in Application.CommandBars(ToolbarName)
    ctl.Enabled = f
    Next ctl
    Set ctl = Nothing
    End Sub

    To disable all controls, use

    ToggleControls "NameOfCustomToolbar", False

    and to enable them again:

    ToggleControls "NameOfCustomToolbar", True

    Replace NameOfCustomToolbar with the name of your custom toolbar.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts