Axis Object Failures Charting in Excel 2007

jkauffman

New Member
Joined
Aug 1, 2007
Messages
1
I've seen multiple questions posted in the past, but no answers to the following problem - I am hoping someone out there can help me. I have exhausted the web and no solutions seem to work for me. I know the answer is probably simple.

I have a dynamic charting program. I am able to change all aspects of the chart successfully except the Value (xlCategory) axis. Everytime I try to set the Min/Max, I get the following error:

Run-time error '-2147467259 (80004005)
Method 'MinimumScale' of object 'Axis' failed

I remember hearing something about Excel 2007 having a Chart bug of sorts where the Shapes object had to be identified, but most solutions do not involved this. I have tried citing the ChartObject (Chart 3 in this instance), ActiveChart, making is all one line, referencing variables, live worksheet cellls, etc. Nothing seems to work. I am pasting the main part of the code below, although the last 4 lines of the code are where the debugger sees the problem (note, I also tried the Shapes route listed below the problem code, which gives me a different error )

<begin>

Sub UpdatingtheChart()
'
' Time to Make Chart
'
Dim chtmaker As Integer

Dim laxis As Integer
Dim haxis As Integer
Dim munit As Integer
Dim lCat As Double
Dim hcat As Double
Dim NumExceptions, Window As Integer
Dim lblrng As Range
Dim chtrng As Range
Dim bigchtrng As Range
Dim chtname As String

'
' Set the Chart Boundries
'

laxis = Sheets("Exceptions").Range("AJ15").Value
haxis = Sheets("Exceptions").Range("AJ16").Value
munit = Sheets("Exceptions").Range("AJ28").Value
lCat = Sheets("Exceptions").Range("AJ6").Value
hcat = Sheets("Exceptions").Range("AJ7").Value
NumExceptions = Sheets("Exceptions").Range("AJ30").Value
Window = Sheets("Exceptions").Range("C4").Value
'
' Set the ChartLabels
'
Sheets("TableSpecial").Activate
Range("GC2").Offset(lCat + 1, 0).Select
Range(Selection, ActiveCell.Offset(hcat - lCat - 1, 7)).Select
Set chtrng = Selection.Cells
Set bigchtrng = Union(Range("FS2:FZ2"), chtrng)
'
' Label Chart - changing chart already created
'
Sheets("Exceptions").ChartObjects("Chart 3").Activate
With ActiveChart
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Trade Date"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Index"
End With
With ActiveChart.Axes(xlValue, xlPrimary)
.MinimumScale = laxis
.MaximumScale = haxis
.MajorUnit = munit
End With
With ActiveChart.Axes(xlValue, xlSecondary)
.MinimumScale = laxis
.MaximumScale = haxis
.MajorUnit = munit
End With
With ActiveChart.Axes(xlCategory)
.MinimumScale = lCat
.MaximumScale = hcat
End With

<end>

Any insight would be apppreciated. This seems so simple to fix, but after 2 weeks of trying to solve this, I need help - bought John Walkenback's books, but cannot find an answer there either.

Regards,

Jeff
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,181,372
Messages
5,929,565
Members
436,679
Latest member
helly123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top