ACC: How to Change a Graph Chart Type Using OLE AutomationLast reviewed: January 6, 1998Article ID: Q154582 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. This article demonstrates how to use Automation to change the chart type of a Microsoft Graph object. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.
MORE INFORMATIONIt is possible to change the chart type of a Microsoft Graph using Automation. However, changing a graph from one type to another automatically resets properties of the graph that do not apply to the new graph type. For example, Trendlines apply to a Two Dimensional Column graph, but do not apply to a Pie chart. Therefore, changing the type from a Column to a Pie drops the Trendline.
Example: Changing a Chart TypeThe following example shows how to produce a chart in the Northwind.mdb database and change a graph's chart type to a 3-Dimensional Pie:
Example: Determine Chart Type of GraphThe following example determines if the chart type of the graph in the earlier example is a 2-Dimensional Bar:
REFERENCESFor more information about the Type property and for a listing of chart types and their constants, open the Microsoft Graph help file (you must have the Vbagrp8.hlp help file installed), and search on "Type" and then view the available topics. For more information about Automation, search on "Automation," and "Automation with Microsoft Access" using the Microsoft Access 97 Help Index. For more examples of Automation between Microsoft Access and Microsoft Graph, see the Office 97 Automation Help File, Auto97.exe. The Auto97.exe file contains the Microsoft Office 97 Automation Help file created by Microsoft Technical Support. This Help file contains Automation theory and multiple examples on automating all the Office 97 products (Microsoft Access, Microsoft Excel, Microsoft Word, Microsoft PowerPoint, and Microsoft Outlook) as well as Microsoft Graph, DAO/ODBCDirect, Microsoft Binder, OLE Messaging, and the Office Assistant. For more information about how to obtain this help file, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q167223 TITLE : Microsoft Office 97 Automation Help File Available on MSL Keywords : kbinterop kbtool IntpGrph Version : 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |