Enrico Pallazo
2005-04-24 11:42:08 UTC
Any idea how to determine which CommandBar or
CommandBarButton/Control/etc. fired the OnUpdate event?
Also, I am having a bit of trouble getting the event to fire. I tried
this in a Class (I didn't forget to instantiate the event) and
ThisWorkbook (can't use WithEvents in a Module) but can't get it to
fire.
I had it working in the office (I am now at my home office), but I
can't remember how I got there...
... from ThisWorkbook ...
Public WithEvents CBars As CommandBars
Public CBar As CommandBar
Private Sub CBars_OnUpdate()
Set CBar = CBars(Me.CommandBars.ActiveMenuBar)
MsgBox CBar.Name & "<_>" & CBar.Index, vbOKOnly, "Class1"
End Sub
CommandBarButton/Control/etc. fired the OnUpdate event?
Also, I am having a bit of trouble getting the event to fire. I tried
this in a Class (I didn't forget to instantiate the event) and
ThisWorkbook (can't use WithEvents in a Module) but can't get it to
fire.
I had it working in the office (I am now at my home office), but I
can't remember how I got there...
... from ThisWorkbook ...
Public WithEvents CBars As CommandBars
Public CBar As CommandBar
Private Sub CBars_OnUpdate()
Set CBar = CBars(Me.CommandBars.ActiveMenuBar)
MsgBox CBar.Name & "<_>" & CBar.Index, vbOKOnly, "Class1"
End Sub