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:
and in a standard module:
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
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:
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
Code:
Private Sub Workbook_Open()
Application.Run "InitialiseChart"
End Sub
Code:
Sub InitialiseChart()
Set myClassModule.mychartclass = Worksheets("Standards").ChartObjects(2).Chart
End Sub
Many thanks for any help or guidance. Excel 2003 by the way.
Simon