I have an excel spreadsheet, Access dumps data in sheet 1 (via VBA), sheet 2 filters the information ready for the charts, sheet 3 is the charts.
Sheet 1 & Sheet 2 work perfectly, however the charts (sheet 3) do not update every time the spreadsheet is opened.
50% of the time it works perfectly, the other 50% of the time it doesn’t update at all.
I need this to update 100% of the time, but I’ve found no clear way in VBA to make it happen! Would think there was a ‘refresh’ option for the chart to make it refresh on opening - but there doesn’t seem to be…
It’s being pulled to another sheet and formatted first ready for the chart, so that doesn’t matter. I don’t think the chart realises the data has updated, so I need to force it to refresh… 50% of the time it refreshes anyway though .
Sub ResetSourceData()
Application.ScreenUpdating = False
On Error Resume Next
ActiveSheet.ChartObjects("Chart 70").Activate
ActiveChart.ChartArea.Select
ActiveChart.Delete
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B8:C11")
End Sub
{edit}
Best I can find on web mentioning oncalculate going into running something
weather that can be mixed with how your chart generation is implimented.