FIX: FOR EACH...ENDFOR Does Not Work with Object VariableID: Q161199 The information in this article applies to:
SYMPTOMSThe FOR EACH...ENDFOR command does not work with an object variable in the group setting. When the group setting is an object variable, the following error message appears:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.
MORE INFORMATIONThe example provided below assumes that the computer has Visual FoxPro 5.0 and Microsoft Excel for Windows 95 version 7.0a installed. The FOR EACH...ENDFOR command is not available in earlier versions of FoxPro. The code opens Excel, adds two workbooks, and lists their names on the Visual FoxPro desktop. Steps to Reproduce Problem Place the following code in a program and run it:
The first FOR EACH...ENDFOR loop places the names for the two workbooks on
the Visual FoxPro desktop. The second loop, using the object variable,
causes an error message.
NOTE: In the above example, if you choose to Ignore the first error message, a "Nesting Error" occurs and the second wb.Name is displayed on the screen.
|
Last Reviewed: November 1, 1997 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |