jmcnamara / XlsxWriter

A Python module for creating Excel XLSX files.
https://xlsxwriter.readthedocs.io
BSD 2-Clause "Simplified" License
3.64k stars 632 forks source link

feature request: add VeryHidden capability #947

Closed laurelgr closed 1 year ago

laurelgr commented 1 year ago

Feature Request

Hi, I recently started playing around with XlsxWriter and it is excellent!

One small thing I noticed, a worksheet only seems to have regular hidden status (appear in unhide menu). To set a sheet as very hidden, I would need to add a VBA macro that runs on file opening, but Excel Online cannot run macros.

Screenshot 2023-02-07 at 9 55 55 AM

I think this might be a small feature to add? It looks like the veryHidden state is stored in same place as regular hidden, at least in the VBA display, in the workbook.xml it translates to setting the sheet state="veryHidden". You could add a worksheet.veryHidden() method or an optional prop worksheet.hide(veryHidden = false) to change the setting.

jmcnamara commented 1 year ago

Good suggestion. I'll add it.

jmcnamara commented 1 year ago

I have added this to main in the worksheet.very_hidden() method. I'll roll in out in a new package in the next few days.

laurelgr commented 1 year ago

Nice, thanks for the update! 🎉

jmcnamara commented 1 year ago

Added upstream in version v3.1.7. Thanks for the prompt.