I wrote a macro in Excel. It's PivotTables pulling from an Access query and feeds 4 charts.
If I'm refreshing the data from the charts, my code works fine, but if do it from the PivotTable, I always get a "Run-time error 91: Object variable or With block variable not set".
What I need is an If...Then statement to check whether a chart is selected, if so run my code, if not return. What I've been trying is along these lines:
If ActiveChart.ChartArea.Select = False Then
Return
Else
Dim srs As Series
For Each srs In ActiveChart.SeriesCollection
srs.Fill.TwoColorGradient Style:=msoGradientHorizontal, Variant:=1
srs.Fill.BackColor.SchemeColor = 2
Select Case srs.Name
...
End Select
Next
End If
End Sub
Thanks in advance for any help.
Brian