XL5: Can't Select Label Attached to Filled Radar SeriesLast reviewed: December 1, 1997Article ID: Q113795 |
The information in this article applies to:
SUMMARYIn Microsoft Excel 5.0, it may not be possible for a Visual Basic subroutine to select an individual data label attached to a filled radar series.
WORKAROUNDIf your subroutine must select an individual data label attached to a filled radar series, you can use the Application.ExecuteExcel4Macro method to select the label. Normally, if you want to select the fourth label in the second series, you would use the following Visual Basic code:
ActiveChart.SeriesCollection(2).Points(4).DataLabel.SelectHowever, if the label is attached to a filled radar series, you must use the following instead:
Application.ExecuteExcel4Macro "SELECT(""Text S2P4"")"Note that the double quotation marks inside the parentheses are necessary because the method will remove a complete set when the command is executed.
MORE INFORMATIONIn Microsoft Excel, there are two types of radar charts:
Type of Radar Chart Description -------------------------------------------------- Wireframe Lines connect the points but are not filled. Filled All lines connect the points and a fill pattern is applied such that a polygon is formed, with the series forming the perimeter of the polygon.In the Microsoft Excel ChartWizard, only the type 6 radar chart is a filled radar chart (all other types of radar chart are wireframes). You cannot mix a wireframe and a filled radar series in the same chart. If you are recording a Visual Basic macro and you select an individual data label attached to a series (in this example, the fourth point of the second series), the recorded code looks like this:
ActiveChart.SeriesCollection(2).Points(4).DataLabel.SelectIf you run this line of code when the second series is a filled radar series, you will receive the error message
Run-time error '1006': Unable to get the DataLabel property of the Point classThe code will run correctly if the series is any other type of series, including a wireframe radar series. To select an individual data label attached to a filled radar series, you must use the Application.ExecuteExcel4Macro method, shown above.
Visual Basic Code ExampleMicrosoft 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 engineers 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 the Microsoft fee-based consulting line at (800) 936-5200. 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/refguide/default.aspThis Visual Basic code example selects the label attached to the fifth point of the second series in a chart and moves the label to the coordinates 20,20. The series is a filled radar series, so the Application.ExecuteExcel4Macro is used to avoid the error described above.
Sub MoveDataLabel() ' Select the fifth point (P5) of the second series (S2). ' Normally, you would use: ' ' ActiveChart.SeriesCollection(2).Points(5).DataLabel.Select ' ' to do this, but this method does not work with a filled radar ' chart in Microsoft Excel 5.0. Application.ExecuteExcel4Macro "SELECT(""Text S2P5"")" 'Change the selection's (the label's) Left property. Selection.Left = 20 'Change the selection's (the label's) Top property. Selection.Top = 20 End Sub |
Additional query words: 5.00 5.00a 5.00c XL5
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |