R
Robin Tucker
Heres and interesting problem:
I have a VB.NET program that creates reports via. Word Automation. This all
works fine. What I want to do as part of this report generation process is
to embed a graph/chart within the report, once again from VB.NET. I have
chosen to use Excel.Chart.8. So, to embed I do this from VB.NET:
Dim theNewShape As InlineShape = m_Document.InlineShapes.AddOLEObject
(ClassType:="Excel.Chart", _
FileName:="", _
LinkToFile:=False, _
DisplayAsIcon:=False, _
Range:=m_Application.Selection.Range)
theNewShape.Width = theShape.Width
theNewShape.Height = theShape.Height
' Store a reference to the OLE for later...
Dim theObject As Object = thenewshape.OLEFormat.Object
I have no idea how to manipulate the data series/values from here on in.
I've spent all day pouring over inadequate Excel VBA documentation and
articles on the internet are scarce. I tried and failed to create series in
the series collection of my chart using VB arrays (its odd, even in the
"quick watch" debug window, changing the series.value(1) from a default
value of 0.0 to 1.0 works (ie. no error), but it changes itself back to 0
right away).
I'm completely confused about how to do this. Can anyone recommend a
tutorial or otherwise explain the basics of getting my data values
(essentially an array of doubles and an array of dates - temperature over
time) into an Excel.Chart control via. VB.NET automation?
I would really appreciate this.
thanks
Robin
I have a VB.NET program that creates reports via. Word Automation. This all
works fine. What I want to do as part of this report generation process is
to embed a graph/chart within the report, once again from VB.NET. I have
chosen to use Excel.Chart.8. So, to embed I do this from VB.NET:
Dim theNewShape As InlineShape = m_Document.InlineShapes.AddOLEObject
(ClassType:="Excel.Chart", _
FileName:="", _
LinkToFile:=False, _
DisplayAsIcon:=False, _
Range:=m_Application.Selection.Range)
theNewShape.Width = theShape.Width
theNewShape.Height = theShape.Height
' Store a reference to the OLE for later...
Dim theObject As Object = thenewshape.OLEFormat.Object
I have no idea how to manipulate the data series/values from here on in.
I've spent all day pouring over inadequate Excel VBA documentation and
articles on the internet are scarce. I tried and failed to create series in
the series collection of my chart using VB arrays (its odd, even in the
"quick watch" debug window, changing the series.value(1) from a default
value of 0.0 to 1.0 works (ie. no error), but it changes itself back to 0
right away).
I'm completely confused about how to do this. Can anyone recommend a
tutorial or otherwise explain the basics of getting my data values
(essentially an array of doubles and an array of dates - temperature over
time) into an Excel.Chart control via. VB.NET automation?
I would really appreciate this.
thanks
Robin