Consulting

Results 1 to 9 of 9

Thread: Solved: How to Turn Off an Unwanted Toolbar

  1. #1

    Solved: How to Turn Off an Unwanted Toolbar

    On one of my worksheets I recently added some hyperlinks each of which will open a workbook. The hyperlinks work just fine, but they cause an unwanted toolbar (named ?Web?) to be displayed at the top of my screen.

    How do I either
    1. Prevent the toolbar from being opened, or
    2. Write a VBA statement to turn off the toolbar?

    I currently turn it off manually, and I would really rather not have to do that.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Application.Commandbars("Web").Enabled = False

    or

    Application.Commandbars("Web").Visible = False

    [/vba]

    perhaps?

  3. #3
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Hi Sid,

    I think I'd lean to the second option Bob posted, as I don't think you want to disable the bar, just get rid of it. Throw it in the Worksheet's FollowHyperlink event:

    [vba]Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Application.CommandBars("Web").Visible = False
    End Sub[/vba]

    HTH,
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  4. #4
    Thanks, Bob. I'm not sure what caused the toolbar to be displayed in the first place, but using "Enabled = False" seems prevent it from being triggered any more.

    Weird ... very weird.

  5. #5
    Oops, just read your post, Ken. OK, I'll try that too. I just ran the "Enable = False" statement once before clicking on the hyperlinks, and I didn't have to use it again.

    I presume that the "Enable = False" is a forever thing that will prevent me from ever seeing it, even when I want to. Is that your point? I'll try "Visible = False" and see if that's just as effective.

    Thanks for the suggestion.
    Sid

  6. #6
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    That's correct, Sid. Running the Enabled = False actually removes it from the Toolbars menu, and the setting is persistent when you restart Excel. Personally I never use that one anyway, but I still try not to disable things (semi) permanently if I can avoid it. Who knows... maybe it actually has a use? LOL!
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  7. #7
    OK, Ken, your suggestion works just as well, so I'll continue to use it.

    Again thanks to both of you. That was really a nuisance.

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by Ken Puls
    That's correct, Sid. Running the Enabled = False actually removes it from the Toolbars menu, and the setting is persistent when you restart Excel. Personally I never use that one anyway, but I still try not to disable things (semi) permanently if I can avoid it. Who knows... maybe it actually has a use? LOL!
    Why? It is just as simple to enable again if wanted.

  9. #9
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    What's the point in disabling the web toolbar? It hardly carries any feature that is going to mess up a spreadsheet. Now if we're talking the control toolbar... well that one I would agree it may be better to disable.

    As a general rule for me, though, I'll disable only if I specifically need to get rid of something. I try not to take it out of the UI unless there is a good reason.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





Posting Permissions

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