From 2007 onwards, I believe it is necessary to Activate
the workbook. This is a really terrible design/implementation, but in my experience it is necessary.
cfSlide.Shapes("CFChart").chart.ChartData.Workbook.Activate
Set wbChart = cfSlide.Shapes("CFChart").chart.ChartData.Workbook
wbChart.Application.WindowState = -4140 '## Minimizes Excel
Set wsChart = wbChart.Worksheets(1)
This gets nasty because then you have to minimize it and/or .Close
it for minimal UI interruption. I like to minimize it immediately, and close it when finished, which you could do wbChart.Close
I think I have read elsewhere that you can avoid this by using a With
block, but I've not been able to successfully implement that, e.g.:
With cfSlide.Shapes("CFChart").chart.ChartData.Workbook
Set wsChart = .Worksheets(1)
' etc...
End With