ID: Q183383
The information in this article applies to:
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.
This article explains how to use the ApplyCustomType method and its arguments.
Microsoft 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/supportnet/refguide/ 
In Microsoft Excel 98, the ApplyCustomType method uses the following syntax
   <Expression>.ApplyCustomType(<ChartType>,<TypeName>)
      xlBuiltIn
      xlUserDefined
      xlAnyGallery
You 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.
   Constant        Source
   ---------------------------------------------------------------------
   xlBuiltIn       Uses custom chart formats in Excel Chart Gallery(8)
                   These formats are included with Microsoft Excel 98.
   xlUserDefined   Uses custom chart formats in Excel Chart User Gallery.
                   You create these formats.
   xlAnyGallery    Uses custom chart formats in Excel Chart User Gallery or
                   Excel Chart Gallery(8).
1. In Microsoft Excel 98, click a chart to select it.
2. On the Chart menu, click Chart Type. Then, click the Custom Types tab.
3. Under Select From, click the type of custom chart formats you want to
   view (User-defined or Built-in).
   Charts(1).ApplyCustomType xlBuiltIn, "Floating Bars"
NOTE: If you specify an invalid TypeName argument, you receive the following error message:
   Run-time error '1004':
   Application-defined or object-defined error
Changing to a 3-D line chart:
To change the active chart to a 3-D line chart, use the following line of code:
   ActiveChart.ApplyCustomType xl3DLine
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:
   Charts(1).ApplyCustomType xlUserDefined, "Rainbow Columns"
    -or-
   Charts(1).ApplyCustomType xlAnyGallery, "Rainbow Columns"
To change the second chart in the workbook to a built-in chart type called "Outdoor Bars," use the following line of code:
   Charts(2).ApplyCustomType xlBuiltIn, "Outdoor Bars"
   Charts(2).ApplyCustomType xlAnyGallery, "Outdoor Bars"
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"(without the quotation marks), click Search, and then click to view the topics.
NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Excel Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:
   ARTICLE-ID: Q179216
   TITLE     : OFF98: How to Use the Microsoft Office Installer Program
Keywords          : kbdta 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbhowtoLast Reviewed: May 18, 1999