Excel 95 3D charting

C

Chris Mortimore

I'm writing a macro that will take a set of values that I give and make a 3D
chart, but I'm writing it in Excel 97 to run on Excel 95. My problem is in
this section...

Charts.Add
ActiveChart.Name = "3D Bar Chart"
ActiveChart.ChartType = xl3DColumn
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(ChartRange), PlotBy _
:=xlRows
ActiveChart.Location Where:=xlLocationAsNewSheet

When the macro is ran under Excel 95, it gets to that section then stops.
This works fine in Excel 97. I think the problem is the line where it sets
the chart type (thats the bit it highlights when debug is clicked). So, my
question: what does Excel 95 call a 3D column chart in macro language? It
appears it doesn't call it an xl3DColumn. Or if that isn't the problem,
anyone got any ideas how to make that section work?

Note: when going into that section, ChartRange is set properly.
 
J

Jon Peltier

Chris -

There are MAJOR differences between VBA in Excel 95 and 97. You should be using
Excel 95 (and the associated help files) to develop the program for use in Excel 95.

There is an issue in Excel 97+ that sounds like your problem. The macro recorder
always sets the chart type, then the source data, but when played back, this
sequence is unreliable. If you set the source data first, the chart type statement
is not likely to throw an error.

- 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