ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel can't execute minimum / maximum scale property (https://www.excelbanter.com/excel-programming/337845-excel-cant-execute-minimum-maximum-scale-property.html)

danz98

Excel can't execute minimum / maximum scale property
 
This has been posted to excel.charting.

I am trying to plot this formula: r = a + b Cos(KQ), on a radar chart. Everything works just fine except that when I change the values of the b variable, Excel will not plot the chart correctly. However, if I manually change the major gridlines, MimimumScale = 0, it plots correctly. The macro recorder sets minimum and maximum to auto (see below). I need to set minimum to 0 (zero). The subroutine stops at ..MinimumScaleIsAuto = True and MinimumScale = 0. The error message is “unable to set MinimumScale Property of Axis class.” Can someone tell me how to overcome this? I appreciate your help.



Thanks.







Private Sub Macro4()

'

' Macro4 Macro

' Macro recorded 8/20/2005 by David O. Antillon

'



'

ActiveSheet.ChartObjects("Chart 15").Activate

ActiveChart.ChartArea.Select

With Selection.Border.LineStyle = 0

End With



'#######

Selection.Interior.ColorIndex = xlAutomatic

'ActiveChart.Axes(xlValue).MajorGridlines.Select

'With ActiveChart.Axes(xlValue)

'.MinimumScaleIsAuto = True

'.MaximumScaleIsAuto = True

'End With



'#######



ActiveChart.Axes(xlValue).MajorGridlines.Select

With ActiveChart.Axes(xlValue)

.MinimumScale = 0

.MaximumScale = 3

.MinorUnit = 0.1

.MajorUnit = 0.5

.Crosses = xlAutomatic

.ReversePlotOrder = False

.ScaleType = xlLinear

.DisplayUnit = xlNone

End With



End Sub




okaizawa

Excel can't execute minimum / maximum scale property
 
Hi,

if you have a y-axis hidden (ChartChart OptionsAxesValue (Y) axis),
try something like this:

ActiveChart.HasAxis(xlValue) = True '<-- add this line
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 3
.MinorUnit = 0.1
.MajorUnit = 0.5
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.HasAxis(xlValue) = False '<-- add this line

--
HTH,

okaizawa


danz98 wrote:
This has been posted to excel.charting.


I am trying to plot this formula: r = a + b Cos(KQ), on a radar chart.
Everything works just fine except that when I change the values of the b
variable, Excel will not plot the chart correctly. However, if I
manually change the major gridlines, MimimumScale = 0, it plots
correctly. The macro recorder sets minimum and maximum to auto (see
below). I need to set minimum to 0 (zero). The subroutine stops at
.MinimumScaleIsAuto = True and MinimumScale = 0. The error message is
$B!H(Bunable to set MinimumScale Property of Axis class.$B!I(B Can someone tell me
how to overcome this? I appreciate your help.



Thanks.







Private Sub Macro4()

'

' Macro4 Macro

' Macro recorded 8/20/2005 by David O. Antillon

'



'

ActiveSheet.ChartObjects("Chart 15").Activate

ActiveChart.ChartArea.Select

With Selection.Border.LineStyle = 0

End With



'#######

Selection.Interior.ColorIndex = xlAutomatic

'ActiveChart.Axes(xlValue).MajorGridlines.Select

'With ActiveChart.Axes(xlValue)

'.MinimumScaleIsAuto = True

'.MaximumScaleIsAuto = True

'End With



'#######



ActiveChart.Axes(xlValue).MajorGridlines.Select

With ActiveChart.Axes(xlValue)

.MinimumScale = 0

.MaximumScale = 3

.MinorUnit = 0.1

.MajorUnit = 0.5

.Crosses = xlAutomatic

.ReversePlotOrder = False

.ScaleType = xlLinear

.DisplayUnit = xlNone

End With



End Sub




danz98

Excel can't execute minimum / maximum scale property
 
Thanks okaizawa. Your suggestion worked. I apologize for being slow getting back to you. The macro recorder doesn't ever use the suggested coding. I recorded several versions but none suggested the code. Again, thanks!

Danz98

"danz98" wrote in message news:gcSNe.2340$Hi.1814@trnddc04...
This has been posted to excel.charting.

I am trying to plot this formula: r = a + b Cos(KQ), on a radar chart. Everything works just fine except that when I change the values of the b variable, Excel will not plot the chart correctly. However, if I manually change the major gridlines, MimimumScale = 0, it plots correctly. The macro recorder sets minimum and maximum to auto (see below). I need to set minimum to 0 (zero). The subroutine stops at ..MinimumScaleIsAuto = True and MinimumScale = 0. The error message is “unable to set MinimumScale Property of Axis class.” Can someone tell me how to overcome this? I appreciate your help.



Thanks.







Private Sub Macro4()

'

' Macro4 Macro

' Macro recorded 8/20/2005 by David O. Antillon

'



'

ActiveSheet.ChartObjects("Chart 15").Activate

ActiveChart.ChartArea.Select

With Selection.Border.LineStyle = 0

End With



'#######

Selection.Interior.ColorIndex = xlAutomatic

'ActiveChart.Axes(xlValue).MajorGridlines.Select

'With ActiveChart.Axes(xlValue)

'.MinimumScaleIsAuto = True

'.MaximumScaleIsAuto = True

'End With



'#######



ActiveChart.Axes(xlValue).MajorGridlines.Select

With ActiveChart.Axes(xlValue)

.MinimumScale = 0

.MaximumScale = 3

.MinorUnit = 0.1

.MajorUnit = 0.5

.Crosses = xlAutomatic

.ReversePlotOrder = False

.ScaleType = xlLinear

.DisplayUnit = xlNone

End With



End Sub





All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com