Knowledge Base

PRB: Closing a Project Does Not Make Other Open Project Active

Article ID: 191764

Article Last Modified on 12/11/1999


APPLIES TO


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...

Additional query words: kbVFp600 kbProjManager

Keywords: kbprb kbcode KB191764