adding a chart and accessing datasheet from API in Word

E

etaub

I have added a reference to my VBE in Word to the MS Graph 8.0 library.



I am trying to create a chart programmatically and do this:



Dim MyChart As chart



Set MyChart =
ActiveDocument.InlineShapes.AddOLEObject("MSGraph.Chart.8")

MyChart.Application.datasheet.Range("A1").Value = 55





The chart is created in Word but when I try to do anything with MyChart
, like access the datasheet object, I get

"Object variable or With variable not set" because it still = Nothing.



What am I doing wrong? Thanks in advance.



ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top