+ Reply to Thread
Results 1 to 5 of 5

Charts.Add, "sticky series" & work-around

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    Charts.Add, "sticky series" & work-around

    I've build a workbook to run a simulation that creates two chart sheets. Each chart contains four data series generated by a function that calls the same chart creation function. I noticed that the second chart contained some but not all series from the first chart. So I ended up adding the following after the Charts.Add line:
    Please Login or Register  to view this content.
    There is probably a method that avoids needing this, but at least it works. Perhaps it applies elsewhere.

    g

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Charts.Add, "sticky series" & work-around

    When you add a chart excel tries to populate it with the data in the region of the active cell.

    If you don't want any series automatically added to the chart make sure the activecell is not around any data.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    Re: Charts.Add, "sticky series" & work-around

    Thanks for the suggestion. Sounds like another instance of MS being more helpful than one might want.

    I'm curious - how might you modify the code below to accomplish this. I tried variations on adding a cell select above the Charts.Add line and ended up with no series in the second chart.

    Thanks, g

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Charts.Add, "sticky series" & work-around

    I tried variations on adding a cell select above the Charts.Add line and ended up with no series in the second chart.
    I thought that was what you were after.

    Use the delete series approach rather than trying to make sure the active cell does not contain data.

  5. #5
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    Re: Charts.Add, "sticky series" & work-around

    Will do. Thanks. g

+ 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