Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Excel 2003 VBA: Detecting and removing toolbars

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
toolbars (removing and reinstating) Atishoo Excel Discussion (Misc queries) 2 February 20th 09 11:30 PM
removing customized toolbars news Excel Discussion (Misc queries) 1 February 24th 05 03:11 PM
Removing all Toolbars in one line matt dunbar Excel Programming 1 October 4th 04 08:54 AM
Removing and replacing toolbars... Big Chris[_26_] Excel Programming 5 January 13th 04 07:36 AM
removing and replacing toolbars Paul James[_3_] Excel Programming 5 January 9th 04 12:23 AM


All times are GMT +1. The time now is 12:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"