PRJ41: ActiveCell Collection Causes MS Project to Hang

Last reviewed: November 24, 1997
Article ID: Q137551
The information in this article applies to:
  • Microsoft Project for Windows 95, versions 4.1, 4.1a

SYMPTOMS

When you use the Visual Basic for applications ActiveCell.Task or ActiveCell.Resource collection, you may receive the following error message:

   WINPROJ caused an invalid page fault in module VBA32.DLL

CAUSE

This problem occurs when the ActiveCell collection is set equal to a variable, the ActiveCell changes, and the macro that contains this code is run more than one time. For example, if you run the following macro twice and select a new task on the second run, Microsoft Project will hang:

   Sub Test()
        Set t = ActiveCell.Task
        MsgBox t.Name
   End Sub

WORKAROUND

To work around this problem, use either of the following methods.

Microsoft provides examples of Visual Basic for applications procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

Method 1:   Use the ActiveCell collection directly without setting a
            variable equal to it, as in the following example:

              Sub Test()
                 MsgBox ActiveCell.Task.Name
              End Sub

Method 2:   Use the ActiveSelection collection, as in the following
            example:

              Sub Test()
                 Set t = ActiveSelection.Tasks
                 MsgBox t(1).Name
              End Sub

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. We are researching this problem and will post more information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: 4.10 4.10a crash bomb lock up gpf gp fault
Keywords : kbcode kbprg kbcode kbprg
Version : 4.10 4.10a
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.