WD: Cannot Trap WordBasic Error 124 with On Error Command

Last reviewed: February 2, 1998
Article ID: Q82113
The information in this article applies to:
  • Microsoft Word for Windows, versions 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

SYMPTOMS

In Microsoft Word versions 2.0a and later, the WordBasic Error 124, "Undefined Sub or Function," cannot be trapped with the On Error command.

MORE INFORMATION

In previous versions of Word for Windows, the following method of error trapping could be used to skip over an undefined subroutine, function, or command:

   Sub Main
      On Error Goto Done
      Mysub
   Done:
   End Sub

Error trapping does not work with undefined subroutines, functions, or commands. The On Error command was designed to trap user errors (such as choosing the Cancel button in a dialog box) rather than program errors. To avoid WordBasic Error 124, the macro must be designed so that it does not call an undefined subroutine, function, or command.

REFERENCES

"Using WordBasic," by WexTech Systems and Microsoft, pages 261, 345


Additional query words: winword2 err resume next word6 macword winword
word95 word7
Version : WINDOWS:2.x,6.0,6.0a,6.0c,7.0, 7.0a; MACINTOSH:6.0,6.01
Platform : MACINTOSH WINDOWS
Issue type : kbhowto kbprb kbinfo


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.