Microsoft KB Archive/45745

From BetaArchive Wiki

WD: "Illegal Function Call" Error When Using a Dialog Box


The information in this article applies to:

  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows, version 7.0
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1


The following are possible causes of an "Illegal function call" (Err=5) in a macro that includes a dialog box:

  1. The location or size of the dialog box causes the box or some portion of the box to be off the screen. This can be identified by the error occurring at the "Begin Dialog" statement.
  2. The dialog box definition does not include an OK and/or Cancel button. This error can be identified by the error occurring at the "Dialog" statement.
  3. The dialog box is larger than the maximum size of a dialog box. For example:

    Begin Dialog UserDialog 5000, 5000

    The above coordinates exceed the maximum size.

  4. Specifying more than one OK or Cancel button in a Microsoft WordBasic custom dialog box causes the error message.

    Note: You can specify a single OK or Cancel button and rename the buttons.
  5. No buttons (OK, cancel, etc.) will cause the "illegal function call" error message. The dialog has to have a way to exit.
  6. In Word 7.0, the error can be caused by a corrupt wordwiz.ini file. The

wordwiz.ini is used by the wizards to store information about the wizard options you choose the last time you ran the wizard. Renaming or deleting the wordwiz.ini will restore the default wizard settings.

For more information, query on the following:

creating and custom and OK and cancel and buttons and word and windows

Additional query words: 1.0 1.1 2.0 1.x winword2 word6 6.0.1 7.0 word95 winword 6.0 macword word7

Keywords : kberrmsg kbmacro wordnt winword ntword macword word6 winword2 word7 word95
Issue type :
Technology :

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