B Soldano
B Soldano

Reputation: 11

How to make a sheet not printable in XlsxWriter

With XlsxWriter I try to make one sheet not printable. I don't want to hide it.

I tried to use .print_area(None) or .print_area(0,-1,0,-1) and .print_area_range without success.

import xlsxwriter

workbook = xlsxwriter.Workbook('noprint.xls')
worksheet0 = workbook.add_worksheet('Tableau')
worksheet0.write(0,0,'make noise')
worksheet1 = workbook.add_worksheet('feuille2')
worksheet1.write(1,1,'my tailor is rich')
worksheet1.print_area(0,0,0,0)
workbook.close()

Upvotes: 0

Views: 37

Answers (1)

BoarGules
BoarGules

Reputation: 16941

You can't do this in Excel itself without writing VBA code that will temporarily hide the sheet, as this answer makes clear. I understand that you don't want to hide the sheet, but that is how Excel itself achieves the effect.

It follows that there is no way for xlsxwriter to do it.

Upvotes: 1

Related Questions