Results 1 to 1 of 1

Retrieving chart series name

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2007
    Posts
    1

    Retrieving chart series name

    I have a macro that copies a chart and its associated data worksheet to a new workbook. In order to remove the charts external references to the original workbook, the macro attempts to edit these references. Since the series used may vary from one instance to the next, I am looping through the series and trying to retrieve the names of them. The code (simplified) looks like this...
     
    nseries=ActiveChart.SeriesCollection.Count
    for i=1 to nseries
       sname=ActiveChart.SeriesCollection(i).name
    
    '   code to reset name, values and Xvalues
    
    next
    This appears to work for all of the series except one. It doesn't appear to matter in what order I put the series, it is always the same one that causes an error.

    Does anyone have any ideas on this?

    Many thanks,
    Martin

    Edited... No reply necessary. Problem was that despite the data range being specified for the offending series, if the cells referenced are empty, the series name cannot be recovered. The problem was solved by temporarily putting in a dummy data pair and deleting it after the name was recovered. Another Excel 'feature'
    Last edited by MartinKilliner; 09-28-2007 at 07:25 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