error - unable to set the XValues property of the series class

V

vjp

Hi,

I am new to excel programming. Want to create a 3D Surface chart. I a
using VB 6.0 and Microsoft Excel 9.0 Object Library. Data for the char
is in the text file and I don't want to put that data in worksheet
Instead I have populated that data in Variant arrays. Three Varian
arrays for 3 Axes. But i am getting error for the following code:

Set objExcelApp = New Excel.Application
Set objExcelWkb = objExcelApp.Workbooks.Add
Set objExcelWs = objExcelWkb.Worksheets(1)
Set objExcelCht = objExcelWkb.Charts.Add
Set objexcelseries1 = objExcelCht.SeriesCollection.NewSerie
 
J

Jon Peltier

I don't expect an error yet with the lines you've posted, especially an XValues
error. The thing with some chart types (including bubble, stock, and surface/contour
charts) is that you need to specify the chart source data first, then specify the
chart type. If you are using a recorded macro as your guide, it will confuse you
because it always says it specified the chart type first (which is the order the
chart wizard steps through). Also, in a surface/contour chart, VBA chokes if you try
to refer to individual series values and xvalues.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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