MS Word 2013 changing chart data from vba

1.1k views Asked by At

Well, in classic fashion, the VBA code I was using to manipulate MS Word 2010 from MS Access 2010 doesn't work 100% since I upgraded to 2013.

One of the problems I'm having is I've lost the ability to change the data behind a Word Chart from VBA. Previously I used the code below:

Dim wdChart as Word.Chart
set wdChart = wdDoc.Shapes("chrtEBACostHistory").Chart

Then I would continue on with .Activate and such.

Now when the code runs, it gets to the second line above and gives me a Run-time error -2147024809 (80070057): This member can only be accessed for a Chart object.

When I run a listing of the Shapes in the file, it's not really showing up. If I change the "Alternative Text" on the chart, the change doesn't show up in the listing. (the listing is simply a loop thru all the Shapes and debug.Print'ing the .AlternativeText)

I tried creating a new chart, thinking it was a version issue, but that didn't change anything.

Any thoughts on this? I need to be able to change the underlying data to several charts in this one particular document from Access.

Thanks!

1

There are 1 answers

0
MultiGuy On BEST ANSWER

Ok, so for some reason, the index order of the charts changed. Once I figured that out, I was able to re-identify the shapes.