Creating a Chart in Excel using VBA
Creating a Chart in Excel using VBA
(OP)
I'm trying to create a pie chart in MS Excel 2000 using VB 6. However, I need to do some computations on the data before sending it into the chart, and I can't create new fields on my worksheet to store the results. So my problem is that as far as I can figure out, I can't use
ActiveChart.SetSourceData because that only takes a range, and my data is currently stored as a dictionary (although I could change that to a two dimensional array). In VB, I found the MSChart control and it's ChartData Property, but I can't figure out how to make it work or begin to see how it'll work in Excel.
Can anyone help me figure out how to show my values in a Pie Chart? Thanks in advance...
Greg
ActiveChart.SetSourceData because that only takes a range, and my data is currently stored as a dictionary (although I could change that to a two dimensional array). In VB, I found the MSChart control and it's ChartData Property, but I can't figure out how to make it work or begin to see how it'll work in Excel.
Can anyone help me figure out how to show my values in a Pie Chart? Thanks in advance...
Greg





RE: Creating a Chart in Excel using VBA
In my opinion it is possible to add data to the Excel worksheet and afterwards add the range to your graph.
Good luck!
RE: Creating a Chart in Excel using VBA
You can assign a computation output value into a cell using a statement like :
Sheets("Sheetname").Range("A1").Value = ResultofCalculation
RE: Creating a Chart in Excel using VBA
Thanks for your input...