Macro creating a chart from table doesn't work
Posted on 2006-06-19
I have a table in Word. If I manually select the table and choose Insert, Object, Microsoft Chart, a chart is created beneath the table and the graph is based on the table I selected (and that info is in the datasheet).
However, if I create a macro to do that, it places the chart into the first table cell instead of beneath it and has the generic chart data (north, south, east west) instead of the data in my table.
The two commands in the macro are:
Selection.InlineShapes.AddOLEObject ClassType:="MsGraph.Chart.8", Filename:="", LinkToFile:=False, DisplayAsIcon:=False
I recorded a macro and that's how I got the above two lines.
Can someone tell me how I can fix the macro so the result is the same as when I create the chart manually?