Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I am having difficulty specifying the docking order of 3 custom toolbars (with names equal to that stored in the variables W, F and A) that are loaded by an add-in application. This code resides in the ThisWorkbook Module of my xla, and is part of a procedure called by the Workbook_Open procedure. Specifically, I have had a few variations on the outcome as I have tried revising the code to get it to work: 1) Initially, code similar to below but using "If" statements instead of "Select Case" failed to make two of the three toolbars visible (though they were enabled, they just were not checked, despite code that should have made them "visible"); 2) Now, with the code below, NO toolbars are displayed when my load routine ends (I should also mention that an earlier section of the code disables the default "Worksheet Menu Bar", "Standard" and "Formatting" toolbars). Further, when I put a Breakpoint on the "With Cmd" statement following Case "A", and a Watch with the Expression "cmd.Name = A", and then step through the code, I can see it get to the Case "A" statement (and the Watch expression then evaluates as "True"), but when I press F8, it goes immediately to End Select without ever executing the code for Case "A". Can anyone advise why this would happen?? Thanks! Jeff Partial code follows: 'At the top of the ThisWorkbook Module: Public Cmd As Object 'CommandBar name Public cmdbar As Object Public W As String Public A As String Public F As String In Workbook_Open: Set cmdbar = Application.CommandBars 'Partial code in the procedure called from Workbook_Open: For Each cmd In cmdbar Select Case cmd.Name Case "W" With cmd .Enabled = True .Visible = True .Position = msoBarTop .Left = 0 .Protection = msoBarNoMove End With Case "F" With cmd .Enabled = True .Visible = True .RowIndex = 2 .Left = 0 .Protection = msoBarNoMove End With Case "A" With cmd .Enabled = True .Visible = True ' .RowIndex = msoBarRowLast .Position = msoBarBottom .Left = 0 .Protection = msoBarNoMove End With End Select Next |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case Statement | Excel Worksheet Functions | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
Challenge - evaluate and select | Excel Discussion (Misc queries) | |||
Convert If..Else to Select Case Statement. | Excel Programming | |||
Data validation with the Select Case statement | Excel Programming |