Microsoft KB Archive/122333

= GP Fault Using LINE.PRINT with RightMarg Greater than 256 =

Article ID: 122333

Article Last Modified on 8/15/2005

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0c
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 4.0a

-



This article was previously published under Q122333



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).



WORKAROUND
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.

