LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hal Hal is offline
external usenet poster
 
Posts: 36
Default Toolbar Reactivation

Below is the code for a module I have based on Steven Roman's "Writing Excel
Macros with VBA". I now need to have a module that will take the data stored
in sheet3 and enable the toolbars I've disabled here.

Can I get some help on how I would read this data from sheet3 and enable the
toolbars?

Thanks in advance.

Hal


Option Explicit

Public Sub ListCmdBars()
Dim sType As String, cbar As CommandBar, rng As Range
Dim cbarCount As Integer, lRow As Long, lCol As Long
lRow = 2
lCol = 2
Sheets("Sheet3").Cells(lRow - 1, lCol - 1) = "Name" 'cbar.Name
Sheets("Sheet3").Cells(lRow - 1, lCol) = "Type" 'sType
Sheets("Sheet3").Cells(lRow - 1, lCol + 1) = "Visible" 'cbar.Visible

For Each cbar In Application.CommandBars
Select Case cbar.Type
Case msoBarTypeNormal 'A toolbar
sType = "Normal"
Case msoBarTypeMenuBar 'A menu bar
sType = "Menu Bar"
Case msoBarTypePopup 'Menu, Submenu
sType = "Popup"
End Select

If cbar.Visible = True Then
Sheets("Sheet3").Cells(lRow, lCol - 1) = cbar.Name
Sheets("Sheet3").Cells(lRow, lCol) = sType
Sheets("Sheet3").Cells(lRow, lCol + 1) = cbar.Visible
cbar.Enabled = False
lRow = lRow + 1
End If
Next

End Sub
 
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
excel toolbar like word toolbar, please Meng[_2_] Excel Discussion (Misc queries) 1 May 23rd 09 04:28 PM
Form Toolbar verses Control Toolbar ub Excel Discussion (Misc queries) 3 July 11th 08 10:57 PM
Adjusting toolbar size, restore toolbar Josh M Excel Discussion (Misc queries) 1 January 18th 06 06:17 PM
How can I keep Toolbar Buttons on the toolbar? weberts2 Setting up and Configuration of Excel 1 July 16th 05 04:30 AM
saving toolbar buttons on custom toolbar Paul James Excel Programming 12 August 6th 03 08:28 AM


All times are GMT +1. The time now is 02:02 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"