PRB: Cannot Use OLE to Access Chart Object in Excel 4.0 |
Q113950
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.
When you use the OLE 2.0 control to embed an Excel version 4.0 chart, the
SourceDoc and SourceItem should contain the fully qualified path, filename,
and chart name. The documentation suggests that Visual Basic should be able
to access the Chart directly, but for Excel version 4.0 this does not work.
This 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.
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 :
Issue type : kbprb
Technology :
|
Last Reviewed: October 12, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |