XL97: Page Fault Displaying Macro Options Dialog Box in Macro

ID: Q168365

The information in this article applies to:

SYMPTOMS

In Microsoft Excel 97, if you run a Visual Basic for Applications macro to display the Macro Options dialog box, you may receive the following error message:

   This program has performed an illegal operation and will be shut down.
   If the problem persists, contact the program vendor.

If you click Details, you receive an error message similar to the following:

   EXCEL caused an invalid page fault in module EXCEL.EXE at
   0137:3003324b.

CAUSE

This problem occurs if the macro includes the following line of code:

   Application.Dialogs(xlDialogMacroOptions).Show

WORKAROUND

Although it is not possible to programmatically display the Macro Options dialog box, it is possible for a macro to control the settings in the dialog box. For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q157108
   TITLE     : XL97: Options not Available in Macro Options Dialog Box

STATUS

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

MORE INFORMATION

In Microsoft Excel 97, you can display the Macro Options dialog box by doing the following:

1. On the Tools menu, point to Macro, and then click Macros.

2. In the Macro dialog box, click a macro in the list of macros, and

   then click Options.

It is not possible for a Visual Basic macro to display this dialog box because it is a child dialog box of the Macro dialog box; that is, the Macro Options dialog box cannot be displayed unless the Macro dialog box is already visible.

NOTE: In earlier versions of Microsoft Excel, an illegal operation does not occur if you attempt to display the Macro Options dialog box. Instead, you receive the following error message

   Run-time error '1004':
   Show method of Dialog class failed

and the Macro Options dialog box is not displayed.

Additional query words: XL97

Keywords          : kberrmsg kbprg xlvbahowto xlvbainfo 
Version           : WINDOWS:97
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: November 1, 1998