I am creating xlsx files with xlsxwriter and want to protect specific cells (for example, all cells in the range B2: B20). The documentation says that you can use the worksheet.protect() method - it enables protection for the entire worksheet by default, and then you can use workbook.add_format({'locked': 0}) to unlock certain cells. But I want the other way around: I want to block only a certain range of cells and leave the rest of the worksheet unlocked. How can i do this?
source share