View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 504
Default CommandBar.Control is inactive after error

I have a CommandBar.Control that becomes inactive after an error is
encountered. I've tried Application.EnableEvents = True with no luck.

Any help will be greatly appreciated.

Thanks.


I have the following code in ThisWorkbook.

Private Sub Workbook_Open()
Dim cCont As CommandBarControl
Set cCont = Application.CommandBars(1).Controls.Add()
With cCont
.Caption = NewCommandBarCaption
.Style = msoButtonIconAndCaption
.FaceId = 643
.OnAction = "Main_Menu"
End With
...

And I have "On Error GoTo ErrHandler" in all my Modules. That code looks
like this.

ErrHandler:
strErrNumber = Err.Number
strErrDescription = Err.Description
strSubName = "some name"
ErrorHandling
End Sub

Module ErrorHandling handles ScreenUpdating, DisplayAlerts and activates
MasterWorkbook.