FilterEdit Method Loses Memory and Causes File Corruption

Q120026


The information in this article applies to:


SYMPTOMS

Using the Visual Basic for Applications FilterEdit method produces an out- of-memory error message. Saving a file after this error causes the saved file(s) to become damaged.


CAUSE

The FilterEdit method does not release memory in all cases. This problem occurs when you set the Create and Overwrite Existing parameters to False.


WORKAROUND

If you run the macro and set the Create and OverwriteExisting parameters to True, the macro runs without producing the out-of-memory message and will not damage your saved file(s).


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products that are listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Enter the following macro into a new module:


  2. 
          Sub OutOfMemory()
    
          For x = 1 to 150
             FilterEdit Name:="critical", TaskFilter:=True, _
             Create:=False, OverwriteExisting:=False, _
             FieldName:="critical", Test:="Equals", _
             Value:="Yes"
          Next x
    
          End Sub 
  3. From the File menu, choose Save. Save the file as BAD.MPP.


  4. From the Tools menu, choose Macros. Run the OutOfMemory macro.


Once you encounter the out of memory message, you have to exit Microsoft Project to free the memory. If you save your file after this message, when you try to reopen the file, Microsoft Project reports the file is damaged.

Additional query words:

Keywords :
Issue type : kbbug
Technology : kbProjectSearch kbProject400


Last Reviewed: November 5, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.