PDA

View Full Version : Solved: How to Turn Off an Unwanted Toolbar



Cyberdude
10-04-2006, 09:12 AM
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.

Bob Phillips
10-04-2006, 09:53 AM
Application.Commandbars("Web").Enabled = False

or

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



perhaps?

Ken Puls
10-04-2006, 02:32 PM
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:

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

HTH,

Cyberdude
10-04-2006, 02:36 PM
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. :bow:

Cyberdude
10-04-2006, 02:42 PM
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

Ken Puls
10-04-2006, 02:47 PM
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!

Cyberdude
10-04-2006, 02:56 PM
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.

Bob Phillips
10-04-2006, 04:05 PM
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.

Ken Puls
10-04-2006, 04:12 PM
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.