Word graph vba (1 Viewer)

Anakardian

Registered User.
Local time
Today, 13:47
Joined
Mar 14, 2010
Messages
173
Good afternoon

I have been struggling with some word automation I set up for a word 2007 document.
It worked ok when it upgraded to 2010 however the upgrade to 2013 completely destroyed the functionality I was using.

The task I an looking to acommplish is relatively simple.

  1. Open the graphdata
  2. refresh the data as it is pulling data from another sheet
  3. Close the chartdata again.
I was using the following code to accomplish this however after the upgrade to 2013 nothing happens.

(GraphX is a number representing the specific graph I am working with.)

Code:
With ActiveDocument.InlineShapes(GraphX)
    'Open and close the chartdata to update data
    ActiveDocument.InlineShapes(GraphX).Chart.ChartData.Activate
    ActiveDocument.InlineShapes(GraphX).Chart.Refresh
    ActiveDocument.InlineShapes(GraphX).Chart.ChartData.Workbook.Close
    End If
End With
Does anyone have a way to open the chart data from VBA in order to refresh the data or alternatively overwrite the data present with something I insert using VBA?


I do not want to embed any spreadsheets as it would just require me to update 50+ graphs individually with the same data.
Linking requires me to have the graphs in the data sheet, something I do not want.
 

Users who are viewing this thread

Top Bottom