Replacing Toolbars and screen not refreshing

Seanzies

Board Regular
Joined
Nov 19, 2005
Messages
212
I have a procedure that runs that hides all toolbars on the Workbook_Open()
and makes them visible on a Workbook_BeforeClose()

With the Application.ScreenUpdating = True I set do the following:


For Each Cell In PersistentData.GetSavedToolbarRange().Cells
BarName = Cell.Value 'the name of the toolbar
If (BarName = "") Then
Exit For
Else
Application.CommandBars(BarName).Enabled = True
Application.CommandBars(BarName).Position = msoBarTop
Application.CommandBars(BarName).Visible = True
End If
Next

The problem that I am having is that when you have more than one workbook open in the same instance of excel running this procedure is running correctly but you can only see one of the toolbars displayed and the rest appear to not be visible when in fact, according to excel under View --> Toolbars they are. So its like Excel is not repainting / refreshing the screen to show all of the toolbars that are enabled and visible.

How can I fix this.

Sincerely,

Very frustrated Programmer & Users

BTW - I didn't see the option to add code tags, they used to be a button you could click to add a code tag..where did they go?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top