How to keep Web Toolbar hidden

J

James A

How can I keep the web toolbar from appearing after doing a hyperlink within
Excel?
 
N

Nick Hodge

James

You could set a Workbook_SheetFollowHyperLink() event code which should shut
it down as you click on a hyperlink. Give it a go and let us know (Needs to
go in the ThisWorkbook module)

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target
As Hyperlink)
Application.CommandBars("Web").Visible = False
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
www.nickhodge.co.uk
 
J

James A

Thanks for your help. I do not know VBA but I tried copy and paste your
statement into the VB editor in "this workbook". I get a compile error
message that says "Procedure declaration does not match description of event
or procedure having the same name". Does this mean this will not work or did
I not enter correctly?.
 
D

Dave Peterson

Nick's code wrapped in the newsgroup post.

Try this editted version.

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, _
ByVal Target As Hyperlink)
Application.CommandBars("Web").Visible = False
End Sub

The underscore followed by a space means that the logical line is continued on
the next physical line.

You could have also put that "private....As Hyperlink" all on one physical line.

James said:
Thanks for your help. I do not know VBA but I tried copy and paste your
statement into the VB editor in "this workbook". I get a compile error
message that says "Procedure declaration does not match description of event
or procedure having the same name". Does this mean this will not work or did
I not enter correctly?.
 
C

Chris Slater

I use a simpler method than other replies, by removing all the commands from
the web toolbar, then move its vestige off the toolbars and onto the very top
bar (Microsoft Excel) where it stays out of the way.
 
Top