A
Alex St-Pierre
Hi!
I have a macro that actualize a chart when the workbook is recalculate.
Using office 2007, I got an error (MinimumScale method of Axis Object has
failed). I don't know if this error is related to Office 2007 or not. I would
like to know if there's a way to avoid the error message (which happens not
very often). I have the same code in 4 sheets of the same workbook (each
sheet contains one graphic).
Thank you!
Alex
Private Sub Worksheet_Calculate()
With ChartObjects("Chart 1").Chart.Axes(xlValue)
.MinimumScale = Range("A51").Value
.MaximumScale = Range("A55").Value
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
End With
With ChartObjects("Chart 1").Chart.Axes(xlValue, xlSecondary)
.MinimumScale = Range("A51").Value - Range("C57").Value
.MaximumScale = Range("A55").Value - Range("C57").Value
End With
End Sub
I have a macro that actualize a chart when the workbook is recalculate.
Using office 2007, I got an error (MinimumScale method of Axis Object has
failed). I don't know if this error is related to Office 2007 or not. I would
like to know if there's a way to avoid the error message (which happens not
very often). I have the same code in 4 sheets of the same workbook (each
sheet contains one graphic).
Thank you!
Alex
Private Sub Worksheet_Calculate()
With ChartObjects("Chart 1").Chart.Axes(xlValue)
.MinimumScale = Range("A51").Value
.MaximumScale = Range("A55").Value
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
End With
With ChartObjects("Chart 1").Chart.Axes(xlValue, xlSecondary)
.MinimumScale = Range("A51").Value - Range("C57").Value
.MaximumScale = Range("A55").Value - Range("C57").Value
End With
End Sub