XL5: GP Fault Running Macro After Adding Option Private

ID: Q120197

5.00 WINDOWS kbprg

The information in this article applies to:

SYMPTOMS

In Microsoft Excel, you receive a general protection (GP) fault if you run a macro using the Macro dialog box after adding the Option Private Module statement to a procedure in an open workbook.

Another symptom of this problem is that a name appears in the Macro Name/Reference list in the Macro dialog box, that does not correspond to a macro contained in any of the open workbooks.

CAUSE

This problem occurs if you display the Macro dialog box, or run a procedure using the Run Macro button, and then add the Option Private Module statement to a procedure in an open workbook. The problem only occurs when you display the Macro dialog box while a module sheet is not the active sheet, after adding the Option Private statement.

The problem occurs because the Macro dialog box does not update correctly with the new macro information. When you add the Option Private Module statement to the beginning of an module, the procedures that are contained in that module do not appear in the Macro dialog box. However, if you run a procedure, or display the Macro dialog box, and then add statement to an open module, you receive a GP fault if you run a procedure using the Macros dialog box while the active sheet is not a module sheet.

Note that you may also receive a GP fault when you choose Cancel in the Macro dialog box.

WORKAROUND

To avoid receiving a GP fault after adding the Option Private Module statement to a Visual Basic module, do either of the following:

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c for Windows.

REFERENCES

For more information about the Option Private Statement, choose the Search button in the Visual Basic Reference and type:

    Option Private

KBCategory: kbprg KBSubcategory:

Additional reference words: 5.00 gpf

Version           : 5.00
Platform          : WINDOWS

Last Reviewed: September 14, 1996