The information in this article applies to:
SUMMARY
When you run a Visual Basic for Applications macro in Microsoft Excel 98,
you can use the ApplyCustomType method to apply standard or custom chart
types to a chart or a series in a chart.
MORE INFORMATIONMicrosoft 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 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/overview/overview.asp SyntaxIn Microsoft Excel 98, the ApplyCustomType method uses the following syntax
where the arguments are as follows:
The xlBuiltIn, xlUserDefined, and xlAnyGallery ConstantsYou can use the ChartType xlBuiltIn, xlUserDefined, and xlAnyGallery constants to determine the source of custom chart formats that the ApplyCustomType method will use. The sources that are used by each constant are listed in the following table.
To view the custom chart formats that are available in Excel Chart
Gallery(8) and Excel Chart User Gallery files, follow these steps:
Because the floating bars type is a built-in custom chart format, use the
xlBuiltIn constant. In most cases, you can also use the xlAnyGallery
constant.
NOTE: If you specify an invalid TypeName argument, you receive the following error message:
If you use the xlAnyGallery constant, Microsoft Excel 98 first look for the specified TypeName in Excel Chart User Gallery. If the TypeName is not found, Microsoft Excel 98 then looks in Excel Chart Gallery(8). If the TypeName is not found, you receive the previous error message. ExamplesChanging to a 3-D line chart:To change the active chart to a 3-D line chart, use the following line of code:
Changing to a user-defined chart:
To change the first chart in the workbook to a user-defined chart type called "Rainbow Columns," use either of the following lines of code:
-or-
Changing to a built-in chart type:
To change the second chart in the workbook to a built-in chart type called "Outdoor Bars," use the following line of code:
Note that you can also use the following line of code:
However, this code does not achieve the same results if a user-defined
chart type called "Outdoor Bars" also exists.
REFERENCES
For more information about using the ApplyCustomType method and the
ChartType property, click the Office Assistant in the Visual Basic Editor,
type ApplyCustomType or ChartType, click
Search, and then click to view the topics.
Q179216 OFF98: How to Use the Microsoft Office Installer Program Additional query words: XL98
Keywords : kbdta |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |