ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommandBar.Control is inactive after error (https://www.excelbanter.com/excel-programming/433576-commandbar-control-inactive-after-error.html)

Kevin

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.


All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com