Class Activate event does not fire

User avatar
ErikJan
BronzeLounger
Posts: 1242
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Class Activate event does not fire

Post by ErikJan »

This is part of a code I'm working on. For some reason I don't understand yet, the class activate event never fires. Someone who can tell me why?

(note: the attached WB only has a few lines of code)
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78478
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Class Activate event does not fire

Post by HansV »

Your code sets clsEventChart.EvtChart to the ActiveChart in the Workbook_SheetActivate event. In other words, the chart had been activated before you set clsEventChart.EvtChart. The Activate event of clsEventChart.EvtChart never fires because of that.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78478
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Class Activate event does not fire

Post by HansV »

Here is an alternative:

Class Activate.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1242
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Class Activate event does not fire

Post by ErikJan »

Clear. Thank you