Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Turning Custom Toolbar On/Off in Template

Status
Not open for further replies.

cheriberi

Technical User
May 27, 2003
60
US
What is the best way to hide/unhide a toolbar via macro?

I used the following code:

Code:
CommandBars("MyToolbar(Details)").Visible = False

and later in the code:

Code:
CommandBars("MyToolbar(Details)").Visible = True

I do have text in parentheses in the name of my toolbar, so I hope that's not the problem. If it is I could change it.

The problem is that in some cases everything works fine, but in others cases I get stuck on the code that is supposed to make it visible again. I get the following error:

Method 'Visible' of object 'CommandBar' failed.

Any suggestions on how to get this to work all the time would be greatly appreciated!
 
Not sure about the parenthesis but these work in Word for me:-

CommandBars("DesDrawing").Visible = True

CommandBars("DesDrawing").Visible = False

Des.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top