We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,408 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

List all toolbars currently visible?

Is there a simple way to list all the toolbars a user currently has visible?


I'm trying to hide everything on screen appart from my worksheet, including the file menu. I've found a way to do it (custom toolbar, hide everything else) but need to be able to restore the original toolbar config when the user exits my app (cos people HATE it when you screw with their setup).

My app is going to run on multiple versions of excel (possibly every version of excel from 97 through to the latest) and I'm developing in excel XP (2003). I'm using the code:

if application.commandbars("toolbar name").visible = true then
   ' {log it to somewhere the user can't see}
     application.commandbars("toolbar name").visible = false
   ' {repeat for all the toolbars I know the names of}
end if

however......I only have one version of excel to play with so not only could a user be running a toolbar not native to excel XP (so I won't know the name of it) but also custom toolbars, which also need to be hidden.

So.....as I say, is there a way to list all toolbars visible?

2
Contributors
1
Reply
1 Day
Discussion Span
1 Year Ago
Last Updated
2
Views
Swoop_GB
Newbie Poster
12 posts since Feb 2011
Reputation Points: 16
Solved Threads: 0
Skill Endorsements: 0

You can try experimenting with this, it might need some playing with to get it working

Dim thiscombar As CommandBar
For Each thiscombar In Application.CommandBars
     thiscombar.Visible = False
Next thiscombar
ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.2799 seconds using 2.63MB