LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Changing Series Name

I have a macro which amoung other things changes the name and values of an
embedded chart. When I run the macro for the first time everything works as
intended. If I rerun the macro, an error occurs at the .name statement. If
I comment out that line, everything else works fine. The same thing happens
if I have saved the file (after the error has occured once), and then re-open
the file and try to run the macro. The error message is

Run time error '1004':
Unable to set the Name property of the series class

Once the error has occured, the macro will never work correctly again unless
I create a new chart, and change the chart name in the macro. If I do this
the macro will work once, and upon subsequent running of the macro, the .name
error will occur.

The section of the code involved is:

k=1
While stock(k) < ""
Sheets("Plot Period").Select
ActiveSheet.ChartObjects("Chart 14").Activate
With ActiveChart.SeriesCollection(k)
.Name = stock(k) 'this is the statement that causes the error
.XValues = "='" + stock(k) + "'!" + daterange
.Values = "='" + stock(k) + "'!" + gainrange
End With

k = k + 1

I have tried other forms of the code, with no success.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing "Series" Name jerry chapman Charts and Charting in Excel 3 April 23rd 23 11:45 AM
changing series value colors zasskar Charts and Charting in Excel 0 June 28th 06 11:13 PM
Changing series information for approximately 60 series in a workb Barb Reinhardt Charts and Charting in Excel 2 January 18th 06 10:22 PM
Changing Series Color Eli Kedar Charts and Charting in Excel 2 July 5th 05 09:43 AM
Quickly Changing Several Series to Appear the Same Barb Reinhardt Charts and Charting in Excel 2 February 7th 05 03:10 PM


All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"