The information in this article applies to:
SYMPTOMSIn Microsoft Visual Basic for Applications, you cannot add a new series to a chart in Microsoft Excel using an array as the Source argument with the Add method of the SeriesCollection object. If you specify the new data as an array of data points, you receive the following error message and your data points are not added to the chart:
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspTo add a new series to a chart in Microsoft Excel using the SeriesCollection object, use either of the following methods. Method 1: Create a New Series from an ArrayAlthough you cannot create a new series from an array in one statement, it is possible to use two steps to complete the task. The following is an example of using this two-step method:
Method 2: Use the Add MethodTo add a new series to a chart in Microsoft Excel using the Add method of the SeriesCollection object, use a Range as the Source argument. For example, to add the range C1:C4 on Sheet1 as a new series to the active chart, use the following syntax:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. MORE INFORMATIONThe information in the Visual Basic Reference in Help incorrectly states that the source argument of the Add method (SeriesCollection) specifies the new data and can be either a Range or an array of data points. However, specifying an array of data points as a series with the Add method will produce the error stated above. REFERENCESFor more information about the Add Method, in the Visual Basic Editor, click
Microsoft Visual Basic Help on the Help menu, type
Add Method (Excel) in the Office Assistant or the Answer Wizard, and
then click Search to view the topic. Additional query words:
Keywords : kbprg kbdta kbdtacode PgmOthr KbVBA |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |