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

Last reviewed: February 2, 1998
Article ID: Q45745
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 95, version 7.0
  • 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


KBCategory: kbusage kbmacro
KBSubcategory:
Additional query words: 1.0 1.1 1.1a 2.0 1.x winword2 word6 6.0.1
7.0 word95 winword 2.0 2.0a 2.0a-CD 2.0b 2.0c 6.0 6.0a 6.0c
macword word7
Keywords : macword ntword winword winword2 word6 word7 word95 wordnt kberrmsg kbmacro
Version : WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a- CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a


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: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.