PRB: Closing a Project Does Not Make Other Open Project Active (191764)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q191764

SYMPTOMS

In Visual FoxPro 6.0, using the Project Object's Close method to close the current Project does not make the other open project the active project.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Place the following code in a program file and run the program:
   LOCAL lnI

   MODIFY PROJECT test1 NOWAIT NOSHOW
   MODIFY PROJECT test2 NOWAIT NOSHOW
   ? "Active Project " + Application.ActiveProject.Name

   FOR lnI = 1 TO Application.Projects.Count
      ? "Project " + ALLTRIM(STR(lnI)) + " " + ;
          Application.Projects.Item(lnI).Name
   ENDFOR

   WAIT WINDOW "Note that project 1 is the active project!" TIME 1
   WAIT WINDOW "Now we are going to close project 1" TIME 1
   Application.Projects.Item(1).Close()
   WAIT WINDOW "Now lets check Application.ActiveProject." TIME 1
   ? Application.ActiveProject.Name
				
When the program executes the last line, the following error message appears:
OLE IDispatch exception code 0 from Visual FoxPro for Windows: 1923:
Object ACTIVEPROJECT is not found...

Modification Type:MajorLast Reviewed:12/11/1999
Keywords:kbprb KB191764