I have a VBA subroutine running in an Excel spreadsheet, that copies a table of values from that spreadsheet to the data table of a chart in a PPTX slide. The PPTX presentation is open and visible. The script uses
Code:
Set chartShapeChart = chartShape.Chart
Set chartDataWorkbook = chartShapeChart.ChartData.Workbook
chartShapeChart.ChartData.Activate
to open the chart data editor. It then copies the data across, and then uses
Code:
chartShapeChart.Refresh
chartDataWorkbook.Close False
to refresh the chart and close the chart data editor, respectively.
However for some reason the chart does not update/refresh as it's supposed to. After the VBA script completes, I need to manually open the data editor in order for the chart to refresh the graphical elements. Note that the data copy is correct, and opening the data editor manually and then closing it without any further edits to the data is all that's needed to refresh the chart.
Is this a known issue with PPTX charts, or am I missing something? Any pointers would be appreciated.