Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm working on a project in which I need to detect which toolbars the
user has in Excel 2003 when they launch Excel, delete all of them, choose and run a spreadsheet (in a new instance of Excel) and restore all of the toolbars as they were when the user started the app. I've had some relatively limited success by iterating through the Application.Toolbars collection, but there seems to be a bit of an inconsistency. I have set up a module with all of the global declarations I believe I'll need. Via some VBA code I found, I believe, at J-Walk.com, that showed how to get a listing of all toolbar names. I've found that it's not enough to sense only if a toolbar is enabled- you also have to consider the toolbar's TYPE. And even here there seems to be some inconsistency. FOr some toolbars, such as Visual Basic, you need to see if Application.CommandBars("Visual Basic").Enabled = True AND _ Application.CommandBars("Visual Basic").Type = msoBarTypeNormal However, for a toolbar such as, let's say, Formatting, you need to say: Application.CommandBars("Formatting").Enabled = True AND _ Application.CommandBars("Formatting").Type = 0 I'm sure that I'm missing something, but this doesn't seem to be at all intuitive. I don't think that I should have to consider a constant in some cases and a value in others. Am I missing something here? IS there a better way to do this? I'd appreciate any assistance. Henry DPM Mellon |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
toolbars (removing and reinstating) | Excel Discussion (Misc queries) | |||
removing customized toolbars | Excel Discussion (Misc queries) | |||
Removing all Toolbars in one line | Excel Programming | |||
Removing and replacing toolbars... | Excel Programming | |||
removing and replacing toolbars | Excel Programming |