XL: Error Programmatically Accessing Data Series on ChartLast reviewed: February 3, 1998Article ID: Q139327 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you run a macro that attempts to access a data series in a chart, you may receive any of the following error messages:
Microsoft Excel 97 for Windows and Excel 98 Macintosh Edition ------------------------------------------------------------- Run-time error '1004': Unable to get the Name property of the Series class. Microsoft Excel 5.0 or 7.0 -------------------------- Run-time error '1006': Unable to get the Name property of the Series class.You may also receive the following error message:
Run-time error '1005': Unable to set the Value property of the Series class. CAUSEThis problem occurs when you run a macro that attempts to access a data series that is not visible on a chart, and the chart is a line, xy (scatter), or radar series chart. The error message appears when the data series is not visible because it has an empty set of y-axis values or has #N/A for all y-axis values. The error that you receive depends on which method you apply to the series or which property you set or return in the macro. If you click Options on the Tools menu, click the Chart tab, and then click "Not Plotted (leave gaps)", all y-axis values are empty. A macro that accesses the series generates a run-time error. If all the y-axis values for the series are #N/A, a run-time error appears regardless of the Options dialog box settings.
WORKAROUNDTo work around this problem, use one of the following appropriate methods.
Method 1: All Y-Values Are EmptyTo work around this problem, use the following steps to make the series visible on the chart:
Method 2: All Y-Values Are #N/ATo work around this behavior, use a formula in the y-axis value cells that returns blank data instead of an error. For example, if the #N/A is the result of the following formula:
=VLOOKUP(C1,D2:E5,2)modify the formula to the following:
=IF(ISERROR(VLOOKUP(C1,D2:E5,2)),"",VLOOKUP(C1,D2:E5,2))This causes any errors (#N/A, #REF!, and so on) to be returned as blanks. Data points that contain blanks for the y-axis values are displayed as zeros on the chart, and the series is visible. The run-time error does not appear when you access the series programmatically.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional query words: 5.00 5.00a 5.00c 7.00 7.00a xl97 xl98
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |