Results 1 to 6 of 6

VBA and Charts in Excel 2007

Threaded View

nsv VBA and Charts in Excel 2007 02-17-2010, 07:10 AM
Andy Pope Re: VBA and Charts in Excel... 02-17-2010, 07:17 AM
nsv Re: VBA and Charts in Excel... 02-17-2010, 07:46 AM
Andy Pope Re: VBA and Charts in Excel... 02-17-2010, 08:41 AM
nsv Re: VBA and Charts in Excel... 02-17-2010, 09:18 AM
Andy Pope Re: VBA and Charts in Excel... 02-17-2010, 09:29 AM
  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    VBA and Charts in Excel 2007

    I have a piece of code that arranges a chart to fit the data it should show. The code used to work perfectly in the old Excel version, but after an "upgrade" to Excel 2007 I get "Automation Error" from the line where the scale type is set.

    ActiveSheet.ChartObjects("Distribution").Activate
        ActiveChart.ChartArea.Select
        ActiveChart.Axes(xlCategory, xlSecondary).Select
        With ActiveChart.Axes(xlCategory, xlSecondary)
            .MinimumScale = Range("S5")
            .MaximumScale = Range("S5") + 14 * Range("S2")
            .MinorUnitIsAuto = True
            .MajorUnitIsAuto = Range("S2")
            .Crosses = xlAutomatic
            .ReversePlotOrder = False
            .ScaleType = xlLinear
            .DisplayUnit = xlNone
        End With
    If I click "Help" on the error message, I am told to insert a "Microsoft Outlook 2002" disk, but I don't have that and I fail to se the relevance.

    How do I set the scale type in Excel 2007?

    I know I should not 'select', but I have copied the method directly from the recorder. If someone can show me how to write the instructions without selecting, please do so.

    NSV
    Last edited by nsv; 02-17-2010 at 09:32 AM.

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