I have a piece of code that arranges a chart to fit the data it should show. The code used to work perfectly in the old Excel version, but after an "upgrade" to Excel 2007 I get "Automation Error" from the line where the scale type is set.
ActiveSheet.ChartObjects("Distribution").Activate
ActiveChart.ChartArea.Select
ActiveChart.Axes(xlCategory, xlSecondary).Select
With ActiveChart.Axes(xlCategory, xlSecondary)
.MinimumScale = Range("S5")
.MaximumScale = Range("S5") + 14 * Range("S2")
.MinorUnitIsAuto = True
.MajorUnitIsAuto = Range("S2")
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
If I click "Help" on the error message, I am told to insert a "Microsoft Outlook 2002" disk, but I don't have that and I fail to se the relevance.
How do I set the scale type in Excel 2007?
I know I should not 'select', but I have copied the method directly from the recorder. If someone can show me how to write the instructions without selecting, please do so.
NSV
Bookmarks