XL: GP Fault Using LINE.PRINT with RightMarg Greater than 256

Last reviewed: September 13, 1996
Article ID: Q122333
The information in this article applies to:
  • Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0, 5.0c
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel, when you run a version 4.0 macro that contains the LINE.PRINT function, you may receive a general protection (GP) fault in module EXCEL.EXE.

CAUSE

The LINE.PRINT function is used in the Microsoft Excel version 4.0 Macro Language to print the active worksheet using methods that are compatible with those found in Lotus 1-2-3. The following is one syntax of the LINE.PRINT function:

   LINE.PRINT(command,setup_text,leftmarg,rightmarg,topmarg,botmarg,pglen
   formatted)

The rightmarg argument above is the argument that specifies the size of the right margin measured in characters from the left side of the page. Anytime you use the LINE.PRINT function with the rightmarg argument set to a value greater than 256, you may receive a general protection (GP) fault when you issue the LINE.PRINT function with the command argument set to 1 (Syntax 1).

WORKAROUNDS

To avoid this problem when you use the LINE.PRINT function in a macro, use any of the following methods.

Method 1: Use a rightmarg argument value of less than or equal to 256.

Method 2: In Microsoft Excel version 5.0 and later, define the print area

          on the worksheet using the Page Setup command on the File menu,
          instead of using the Define Name dialog box. This problem only
          occurs when you define the name "Print_Area" on your worksheet
          without using the sheet name, such as "$A$1:$Z$1."

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

"Function Reference ," version 4.0 pages 253-254


KBCategory: kbprg kbmacro
KBSubcategory: xlwin

Additional reference words: 7.00 4.00 5.00 5.00c line print gpf 0002:02DE
ms
excel 4.0 macro



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