XL97 - Command Bar Removal

T

Trevor Williams

Dear All

Has anyone got a snipet of code that remembers which
CommandBars were visible on open so that on exit they can
be switched back on.

I can do all or nothing at the moment

Thanks in advance

Trevor
 
R

Ron de Bruin

Hi Trevor

Use the Enabled property instead of the Visible

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next

To get them back use this

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = True
Next
 
Top