+ Reply to Thread
Results 1 to 2 of 2

Excel macro stops at MinimumScaleISAuto and MinimumScale = 0

  1. #1
    danz98
    Guest

    Excel macro stops at MinimumScaleISAuto and MinimumScale = 0

    This has been posted to excel.programming.

    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




  2. #2
    Jon Peltier
    Guest

    Re: Excel macro stops at MinimumScaleISAuto and MinimumScale = 0

    Just plotting static values, not calculations, I had no issue with your code.

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    danz98 wrote:

    > This has been posted to excel.programming.
    >
    >
    > 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
    >
    >
    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1