Results 1 to 13 of 13

Secondary y-axis to auto scale not working: throwing Method 'Axes' of object '_Chart' fail

Threaded View

ChennuS Secondary y-axis to auto... 01-18-2019, 10:01 AM
AliGW Re: Secondary y-axis to auto... 01-18-2019, 10:03 AM
MrShorty Re: Secondary y-axis to auto... 01-18-2019, 12:46 PM
ChennuS Re: Secondary y-axis to auto... 01-23-2019, 03:39 AM
MrShorty Re: Secondary y-axis to auto... 01-23-2019, 10:18 AM
ChennuS Re: Secondary y-axis to auto... 01-24-2019, 10:47 AM
romperstomper Re: Secondary y-axis to auto... 01-24-2019, 11:05 AM
ChennuS Re: Secondary y-axis to auto... 01-25-2019, 08:09 AM
romperstomper Re: Secondary y-axis to auto... 01-25-2019, 11:23 AM
ChennuS Re: Secondary y-axis to auto... 01-28-2019, 08:18 AM
romperstomper Re: Secondary y-axis to auto... 01-28-2019, 08:21 AM
ChennuS Re: Secondary y-axis to auto... 01-28-2019, 08:33 AM
romperstomper Re: Secondary y-axis to auto... 01-28-2019, 08:38 AM
  1. #1
    Registered User
    Join Date
    01-18-2019
    Location
    Zurich
    MS-Off Ver
    2013
    Posts
    8

    Secondary y-axis to auto scale not working: throwing Method 'Axes' of object '_Chart' fail

    Hi,
    I have a about 12 charts in my worksheet. About 6 charts (Clustered column charts) of them have primary & secondary axis.
    I have a macro which align the primary & secondary axes to zero. So far good.
    The input of my chart changes and I want to be able to reset the axes value to auto and have a macro for that.
    The code works fine for the primary y-axis, but I run into the Method 'Axes' of object '_Chart' failed for the secondary y-axis (highlighted in red and underline in the code below).
    How can this be fixed?

    Any ideas about how this can be fixed would be very much appreciated.

    'Reset the axes values to Automatic
    Sub ResetScalesToAuto()
    
    
        Dim oChrtObj As ChartObject
        For Each oChrtObj In Worksheets("ChangeDrivers").ChartObjects
          With oChrtObj.Chart
            With .Axes(2, 1)
              .MinimumScaleIsAuto = True
              .MaximumScaleIsAuto = True
            End With
    
              With .Axes(2, 2)
              .MinimumScaleIsAuto = True
              .MaximumScaleIsAuto = True
            End With
            End With
              Next oChrtObj
    End Sub

    Thanks
    Last edited by ChennuS; 01-18-2019 at 10:04 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-15-2017, 05:34 AM
  2. Create multiple pivot charts [Error: Method 'SetSourceData' of object '_chart' failed]
    By DianCharloValentine in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2014, 07:51 AM
  3. Secondary axis not picking up amended data for axis scale
    By AileenR in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 10-02-2013, 06:17 AM
  4. method 'location' of object '_Chart' failed.
    By Hendel in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-29-2008, 01:03 PM
  5. Method 'SeriesCollection' of object '_Chart'failed
    By Dennis Mak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2006, 02:55 AM
  6. Run-time error '1004'; Method 'Export' of object'_Chart' failed
    By Father Guido in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2005, 10:35 AM
  7. Run-time error 1004: Method 'Axes' of object '_chart' failed
    By Brian Morrison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2005, 11:05 AM

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