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

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

Additional query words: 5.00c line print gpf 0002:02DE ms excel 4.0 macro

Keywords : xlwin
Version : 4.00 4.00a 5.00 5.00c 7.00
Platform : WINDOWS
Issue type :


Last Reviewed: September 15, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.