+ Reply to Thread
Results 1 to 3 of 3

Cannot Activate Chart Area in Chart. Chart Object Failed

  1. #1

    Cannot Activate Chart Area in Chart. Chart Object Failed

    I am working to update the series source in a chart. I have an excel
    template in which I copy 2 worksheets into my workbook.

    I would like to edit one chart using my VBA code. I am getting Method
    PlotArea of Object '_Chart' Failed.

    The code is below.

    Thanks for your help.

    Sheets(1).Select
    ActiveSheet.ChartObjects("WhatMatters").Activate
    ActiveChart.PlotArea.Select


  2. #2
    Jon Peltier
    Guest

    Re: Cannot Activate Chart Area in Chart. Chart Object Failed

    1. If the chart has no data to plot, there may not be a plot area to select.

    2. Don't keep selecting all the objects. It will be faster and less
    distracting this way:

    With ActiveSheet.ChartObjects("WhatMatters").Chart.PlotArea
    ' do whatever to the plot area
    End With

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______


    <[email protected]> wrote in message
    news:[email protected]...
    >I am working to update the series source in a chart. I have an excel
    > template in which I copy 2 worksheets into my workbook.
    >
    > I would like to edit one chart using my VBA code. I am getting Method
    > PlotArea of Object '_Chart' Failed.
    >
    > The code is below.
    >
    > Thanks for your help.
    >
    > Sheets(1).Select
    > ActiveSheet.ChartObjects("WhatMatters").Activate
    > ActiveChart.PlotArea.Select
    >




  3. #3
    Tony
    Guest

    Re: Cannot Activate Chart Area in Chart. Chart Object Failed

    Thanks. I used your suggested code but now I am getting a 424 Object
    required error.

    'error here
    With ActiveSheet.ChartObjects("WhatMatters").Chart.PlotArea
    .SeriesCollection(1).XValues = "='" & managerDataSheet & "'!" &
    graphXValueAddress
    .SeriesCollection(1).Values = "='" & managerDataSheet & "'!" &
    completeGraphAddress
    End With

    Thoughts?


+ Reply to Thread

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