I'm trying to write code that will conditionally format individual data points in a Pivotchart form. I am getting the error "Error 13: Type Mismatch" for the following line of code:
Set objChartSpace = Me.Form.ChartSpace
I used the following support page as a guide ( but am confused because in the example they use the code:
Set objChartSpace = Me.PivotChart.Form.ChartSpace
instead. But when I try and type this into VBA, "PivotChart" is not even an option (I believe I have referenced everything correctly).
After that I'm not even sure if my coding will work b/c I can't get past setting objChartSpace to the current pivotchart forms' Chartspace.
Any ideas on what I'm doing wrong? Also, I realize conditional formatting can be done using Access, but my formatting is more complicated than Access allows you to do.
Thanks
Set objChartSpace = Me.Form.ChartSpace
I used the following support page as a guide ( but am confused because in the example they use the code:
Set objChartSpace = Me.PivotChart.Form.ChartSpace
instead. But when I try and type this into VBA, "PivotChart" is not even an option (I believe I have referenced everything correctly).
After that I'm not even sure if my coding will work b/c I can't get past setting objChartSpace to the current pivotchart forms' Chartspace.
Any ideas on what I'm doing wrong? Also, I realize conditional formatting can be done using Access, but my formatting is more complicated than Access allows you to do.
Thanks
Code:
Dim objChartSpace As OWC11.ChartSpace
Dim objChart As OWC11.ChChart
Dim objSeries As OWC11.ChSeries
Set objChartSpace = Me.Form.ChartSpace
Set objChart = objChartSpace.Charts(0)
For Each objSeries In objChart.SeriesCollection
If Me.ESA1_EtchantActualpH.Value > 8.4 Then _
objSeries.Interior.Color = vbRed
Next