CommandBar.Control is inactive after error

K

Kevin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top