Skip to main content

SetPrintGridlines

Sets whether cell gridlines are printed with the worksheet.

Syntax​

expression.SetPrintGridlines(bPrint);

expression - A variable that represents an ApiPageSetup class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
bPrintRequiredbooleanSpecifies whether the cell gridlines are printed.

Returns​

boolean

Example​

Print cell gridlines together with the worksheet content in a spreadsheet.

// How do I make gridlines appear on the printout in a spreadsheet?

// Show the cell gridlines when printing a worksheet in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let pageSetup = worksheet.GetPageSetup();
pageSetup.SetPrintGridlines(true);