Hi all I am confusing myself over where code needs to sit, and standard versus class modules. I have an embedded bar chart, that needs to run a macro when any of the bars are selected. when this was a chart sheet it worked fine, but I can seem to get it working as an embedded chart. Currently my class module looks like this:
In the Thisworkbook code:
Public WithEvents mychartclass As Chart Private Sub mychartclass_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long) Application.Run "MFChart" MsgBox "Success" End Sub
and in a standard module:
Private Sub Workbook_Open() Application.Run "InitialiseChart" End Sub
what am i doing wrong, have i got something in the wrong place ? Many thanks for any help or guidance. Excel 2003 by the way. Simon
Sub InitialiseChart() Set myClassModule.mychartclass = Worksheets("Standards").ChartObjects(2).Chart End Sub
This question generated 21 answers. To proceed to the answers, click here.
This thread is current as of February 10, 2014.