XL: GP Fault If Many Line Continuation Characters in Module

Last reviewed: April 8, 1997
Article ID: Q111984

The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a

SYMPTOMS

In Microsoft Excel 5.0, you may receive a general protection (GP) fault if you copy and paste lines of code that contain the line-continuation character (_) in a Visual Basic subroutine.

In Microsoft Excel 7.0, you may receive the following error message if you copy and paste lines of code that contain the line-continuation character (_) in a Visual Basic subroutine:

   Too many line continuations

CAUSE

You receive the GP Fault if you copy lines in a Visual Basic procedure that contain line-continuation characters, and paste the lines in a procedure so that there are more than a total of ten consecutive lines joined with line-continuation characters.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed above. This problem was fixed in Microsoft Excel 97.

WORKAROUND

To prevent this error from occurring, do not copy and paste lines that end in line-continuation characters if the resulting code will contain more than nine consecutive lines that end with the line-continuation character.

MORE INFORMATION

When you enter code in a Visual Basic module in Microsoft Excel, you can use an underscore (_) as a line-continuation character. When you type this character at the end of a line, the next line is appended to the current line when you run the subroutine.

For example, when you run the following code

   Example = "Test 1 " & _
      "Test 2"

the line is evaluated as if you typed it as follows:

   Example = "Test 1 " & "Test 2"

Normally, you can type up to nine consecutive lines with line-continuation characters. If you type a tenth consecutive line with a line-continuation character, you will receive the error message

   Too many line continuations

and the tenth line-continuation character is automatically removed.

However, when you copy and paste consecutive lines that end in a line- continuation character, you can easily exceed the nine line limit. When you do this, you receive the error message above as expected. Additionally, the screen may be redrawn incorrectly; lines in your procedure may be missing and others may display twice. You may also receive a GP Fault.


Additional query words: 5.00 5.00c err msg
Keywords : kbbuglist
Version : 5.00 5.00c
Platform : WINDOWS


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