The information in this article applies to:
SYMPTOMS
Excel exposes a variety of objects which can be accessed from Visual Basic
by using Object Linking and Embedding (OLE) or the OLE control. The Excel
Chart is one of these objects. However, if the chart is embedded in an
Excel version 4.0 spreadsheet, there is no direct way to activate the Chart
using OLE automation. This article gives you two possible solutions. CAUSEThis is a problem with Excel version 4.0 and OLE. Excel version 4.0 does not correctly write the path to the embedded object as the OLE layer expects. RESOLUTIONTwo Possible SolutionsYou can copy and paste the chart object into a separate chart sheet and perform the OLE automation with that. To do this, double-click the chart object and choose Edit Copy. Then choose File New, and select Chart. Then choose Edit Paste to paste the chart into the blank chart sheet. This chart will still be linked to the worksheet data, so it will automatically update when the worksheet data is changed.The second option is to upgrade to Excel version 5.0, which is capable of linking to a Chart Object within an Excel Sheet (or Book). In this case, you would set the SourceDoc property to: C:\EXCEL\BOOK1.XLS!Sheet1![BOOK1.XLS]Sheet1 Chart 1Here the portion up to the exclamation mark (!) is the path to the file, and the rest of the information specifies the Chart within the Sheet within the Book. Additional query words:
Keywords : |
Last Reviewed: October 12, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |