Results 1 to 2 of 2

Thread: runtime 1004: method of axes failed

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    42

    Talking runtime 1004: method of axes failed

    Hi,
    this line of code is giving me a method of axes failed error msg.
    Can anyone fix it?

    .Axes(xlCategory, xlSecondary).CategoryType = xlCategoryScale

    Below is the code that is before the above line:

    With ActiveChart
    .ChartType = xlLineMarkers
    .SeriesCollection.NewSeries
    '.SeriesCollection(1).AxisGroup = 2
    '.SeriesCollection(2).AxisGroup = 2
    .HasLegend = True
    .Legend.Position = xlRight
    .Axes(xlCategory).MinorTickMark = xlOutside
    .Axes(xlValue).MinorTickMark = xlOutside

    .ChartArea.Select
    .HasAxis(xlCategory, xlPrimary) = True
    .HasAxis(xlCategory, xlSecondary) = True
    .HasAxis(xlValue, xlPrimary) = True
    .HasAxis(xlValue, xlSecondary) = False

    .Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
    'Errors here
    .Axes(xlCategory, xlSecondary).CategoryType = xlCategoryScale

    ' some more code here but doesn't involve error
    End With

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: runtime 1004: method of axes failed

    Isn't is Axis ?

    Edit:
    Ok it is Axes... so it must be that there is not Category property you are trying to change on that object.
    Try removing the categorytype part and see if it works?
    Last edited by Ecniv; Jul 21st, 2005 at 03:11 AM.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width