Graph Auto Scale Not Working

kgaines

New Member
Joined
Jun 9, 2010
Messages
1
We just upgraded from Excel 2003 to Excel 2007. I have graph where I can use a drop down to select different departments to view. Since the upgrade the "auto" scale on the Y axis is not working on some of the graphs. Some display properly and some do not. The scale is way too high.

I also have a macro that I use to print the whole set - the macro works (it prints) but again, it is not autoscaling the Y axis. It is set in the macro:
.MinimumScaleIsAuto = True
.MaximumScaleIsAuto = True

Any help would be greatly appreciated.
Kat
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Taupaji - Kat has done what the knowledge base article says to do.

Kat - If the workbook and its charts were constructed in Excel 2003, things might not always work exactly right in 2007. You may need to recreate the charts in 2007 before they update the way you'd expect.
 
Upvote 0
I used the following macro to extract data out of old link-broken charts in a ppt and to scale them. Since you too are extracting data out of the charts. Its better if you scale the excel manually using this data.
Hope this might work for you... I am also new here.. Just trying to help with whatever little I can as this site has helped me a lot... (Runs in excel...)
Code:
Sub FixAllChartsinPPTandExtractData()
Dim oSl As PowerPoint.Slide
Dim oSh As PowerPoint.Shape
Dim ppApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim sr As Integer
Dim BaseWks As Worksheet
Dim maxval, minval As Double

Set ppApp = New PowerPoint.Application
FILENAME = Application.GetOpenFilename("PPT, PPTx, PPS and PPSx,*.pp*", 1, "Select Powerpoint file", , 0)
Set PPPres = GetObject(FILENAME)
Set BaseWks = Workbooks.Add(xlWBATWorksheet).Worksheets(1)

BaseWks.Activate

For Each oSl In PPPres.Slides
    For Each oSh In oSl.Shapes
        ActiveSheet.Cells.Clear
        If oSh.Type = msoChart Then
            sr = oSh.Chart.SeriesCollection.Count
            For j = 1 To sr
                With oSh.Chart.SeriesCollection(j)
                    .Format.Line.Weight = 1
                    .Format.Line.Style = msoLineSingle
                    .MarkerStyle = xlMarkerStyleNone
                    vntData = .Values
                    vntLabels = .XValues
                    For lngIndex = LBound(vntData) To UBound(vntData)
                        ActiveSheet.Cells(lngIndex, 0 + j) = vntData(lngIndex)
                    Next
                End With
            Next
            ActiveSheet.Cells(2000, 2000) = "=-1*MROUND((-1*MAX(A:Z))-2,5)"
            maxval = Cells(2000, 2000).Value
            ActiveSheet.Cells(2000, 2000) = "=-1*MROUND((-1*MIN(A:Z))+2,5)"
            minval = Cells(2000, 2000).Value
            With oSh.Chart.Axes(xlValue)
                .MinimumScaleIsAuto = False
                .MinimumScale = minval
                .MaximumScaleIsAuto = False
                .MaximumScale = maxval
                .MinorUnitIsAuto = True
                .MajorUnit = 5
                .Crosses = xlAutomatic
                .ReversePlotOrder = False
                .ScaleType = xlLinear
                .DisplayUnit = xlNone
            End With
        oSh.Chart.PlotArea.Interior.Color = vbWhite
        oSh.Chart.ChartArea.Interior.Color = vbWhite
        oSh.Chart.ChartTitle.Font.Color = vbBlack
        oSh.Chart.ChartArea.Font.Color = vbBlack
    End If
    Next
Next
BaseWks.Parent.Close True
End Sub
 
Last edited:
Upvote 0
This must be terribly slow, populating one cell at a time:

Code:
For lngIndex = LBound(vntData) To UBound(vntData)
    ActiveSheet.Cells(lngIndex, 0 + j) = vntData(lngIndex)
Next

Dump the array in one step:

Code:
ActiveSheet.Cells(lngIndex,1).resize(, UBound(vntData) + 1 - LBound(vntData)).Value = vntData
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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
Back
Top