Excel Chart Axes Naming

Okay, this should be pretty simple, but after 4 hours, I still can’t get it! I’ve got a bar chart that’s being created from a Navision report into Excel. At the bottom of the chart I want to put the Category (X) Axis Label “Aged Account Balances”. If you pull up the chart source data window, this is the field on the series tab at the bottom. When I tried it in VB I got: ActiveChart.SeriesCollection(2).Select ActiveChart.SeriesCollection(1).XValues = “={”“Aged Account Balances”"}" ActiveChart.SeriesCollection(2).XValues = “={”“Aged Account Balances”"}" ActiveChart.SeriesCollection(3).XValues = “={”“Aged Account Balancesf”"}" ActiveChart.SeriesCollection(4).XValues = “={”“Aged Account Balances”"}" ActiveChart.SeriesCollection(5).XValues = “={”“Aged Account Balances”"}" I looked at the Excel Help and tried working this through the series. No luck. I tried working it through the CategoryName variable. No luck. I’ve pretty much tried everything you can imagine to find a way to name the category. Any ideas?

Here’s how I read the help: 1) A Chart has an ‘Axes’ function that (usually) returns an ‘Axis’ object. The ‘Axes’ function takes a XLAxisType argument where 1 is the ‘Category’ axis, 2 is the ‘Value’ axis… 2) You have to set an Axis’ HasTitle property to True before messing with the Axis’ AxisTitle property (see Excel VB Help on the AxisTitle object…) 3) Once you have an AxisTitle object, you can set either its Caption property and/or its Text property – both these properties say they change the text of the axis title…! So, the code might look something like:// set the Category axis title... xlChart.Axes(1).HasTitle := TRUE; xlChart.Axes(1).AxisTitle.Caption := 'Aged Account Balances';

Fritz, Thanks so much for your help, and I’m embarrased that it’s taken me this long to get back to you…my apologies. We have been EXTREMELY busy here. I tried the code you gave me and found one class problem - AXES didn’t have the AxisTitle method (using Excel 8.0 version), so I had to take it down to the AXIS class. Here’s what I came up with: ____________________________________________________ xlChart := xlSheet[SheetNumber].ChartObjects(ChartNumber); xlChart.Activate; xlAxis := xlChart.Axes(1); xlAxis.HasTitle := TRUE; xlAxis.AxisTitle.Caption := Name; _____________________________________________________ This worked like a charm! [8D] Again, Fritz, thanks so much for your help! My charts look great!!!