Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > How to set the MaximumScale of a XYScatter


Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2009, 09:44 AM
henkvisser henkvisser is offline
Newcomer
 
Join Date: May 2009
Posts: 3
Default How to set the MaximumScale of a XYScatter chart


Hi, I'm populating an existing XYScatter chart from Access. This all works fine, with different series and all. Access open this workbook, then select this existing chart by its name and adds the series. The "Value (X) axis scale" for Minimum and Maximum (value, not unit!) are off (unchecked) and set to 0 and 6. However, after I've populated the chart from Access, these are set to checked! I can't get them to unchecked through VB, but I really have to fix this. Help appreciated!

This is what I have so far, but it doesn't do the job.:
Code:
        With ActiveChart
            '.ChartType = xlXYScatter
            .Axes(xlCategory).MaximumScale = 6
            .Axes(xlCategory).MinimumScale = 0
            .HasAxis(xlCategory, xlPrimary) = False
            .HasAxis(xlCategory, xlSecondary) = False
            .HasAxis(xlValue, xlPrimary) = False
            .HasAxis(xlValue, xlSecondary) = False

Last edited by henkvisser; 05-28-2009 at 10:00 AM.
Reply With Quote
  #2  
Old 05-28-2009, 10:42 AM
Mill Mill is offline
Just another Excel nerd

Retired Moderator
* Guru *
 
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,631
Default

Try [code].Axes(xlCategory).MaximumScaleIsAuto = False[/scale]

I'm not sure though...
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
Reply With Quote
  #3  
Old 05-28-2009, 10:51 AM
henkvisser henkvisser is offline
Newcomer
 
Join Date: May 2009
Posts: 3
Default

I figured it out. I set the code below after everything else. And does seem to do the trick!

Code:
  ActiveChart.Axes(xlValue).Select
                With Selection.Border
                    .Weight = xlHairline
                    .LineStyle = xlNone
                End With
                With Selection
                    .MajorTickMark = xlNone
                    .MinorTickMark = xlNone
                    .TickLabelPosition = xlNone
                End With
            With ActiveChart.Axes(xlValue)
                    .MinimumScale = 0.9
                    .MaximumScale = 14.7
                    .MinorUnitIsAuto = True
                    .MajorUnitIsAuto = True
                    .Crosses = xlCustom
                    .CrossesAt = 0.9
                    .ReversePlotOrder = False
                    .ScaleType = xlLinear
                    .DisplayUnit = xlNone
            End With
            
            ActiveChart.Axes(xlCategory).Select
                With Selection.Border
                    .Weight = xlHairline
                    .LineStyle = xlNone
                End With
                With Selection
                    .MajorTickMark = xlNone
                    .MinorTickMark = xlNone
                    .TickLabelPosition = xlNone
                End With
            With ActiveChart.Axes(xlCategory)
                    .MinimumScale = 0
                    .MaximumScale = 6
                    .MinorUnitIsAuto = True
                    .MajorUnitIsAuto = True
                    .Crosses = xlAutomatic
                    .ReversePlotOrder = False
                    .ScaleType = xlLinear
                    .DisplayUnit = xlNone
            End With
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->