FIX: Excel Automation Samples Cause Errors with Excel 97Last reviewed: October 29, 1997Article ID: Q168192 |
The information in this article applies to:
SYMPTOMSThe OLE automation script in the Olexl.scx example form that creates a chart in Microsoft Excel fails with Microsoft Excel 97. Several lines of code contain the incorrect syntax for use with Microsoft Excel 97. Executing the code causes the following error message to appear:
OLE error code: 0x80020006:Unknown name.This OLE automation code is part of the Olexl.scx sample located in the Samples\Solution\Ole folder.
CAUSEThe syntax for referencing objects in Microsoft Excel 97 has changed.
RESOLUTIONOpen the Olexl.scx form and click on the Example 2 command button. In the properties sheet, open the Click event of the Example 2 object. Locate the following three lines of code, which are interspersed throughout the code in the Click event:
oXLChart1.autoformat(11,1) nTotSeries = oXLChart1.SeriesCollection().count oXLChart1.SeriesCollection(m.i).deleteNow change them to the following:
oXLChart1.application.charts[1].autoformat(-4100,1) nTotSeries = oXLChart1.application.charts[1].SeriesCollection().count oXLChart1.application.charts[1].SeriesCollection(m.i).deleteTo help locate these lines of code, open the Click event code, click Edit on the system menu and select Properties. In the Edit Properties dialog box, check the Show line/column position check box and click OK. Line numbers now appear in the status bar. The three lines listed above have the following line numbers: 16, 19, and 21.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Microsoft Visual FoxPro version 5.0a for Windows.
MORE INFORMATION
Steps to Reproduce Behavior
Keywords : FxinteropExcel FxprgGeneral vfoxwin vfpbug5.0 vfpfix5.0a kberrmsg kbbuglist kbfixlist Technology : kbole Version : 5.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |