Add "read" sheet protection to Excel file

@tstolle94 OK how about this.

This program is designed to apply the formatting from one Excel sheet (‘default_1’) to another sheet (‘default_2’) without copying the content. It takes the formatting from the header (first row) of ‘default_1’ and applies it to the header of ‘default_2’. Then, it applies the formatting from the first data row (second row) of ‘Sheet1’ to all other rows in ‘default_2’. The content of ‘default_2’ remains unchanged, only the formatting is updated.

The program is implemented using the openpyxl library in Python, which is widely used for handling Excel files. It provides various functions and classes for working with Excel files, such as loading workbooks, accessing sheets, iterating through rows and columns, and modifying cell styles and formatting.

Built into a KNIME workflow. You can switch out the names an path obviously:

“default_1” has the formats you want for your header and the program will apply them to the header of “default_2” and all the lines it has

The format would then be applied to all lines (you could autosize when exporting from KNIME or later)

The other code would just have a sheet that has full formats and transfer that to the whole other sheet which data has been written out from KNIME.

And yes, the code has mostly been written by ChatGPT. So if you want to modify it there are also options to do that.

1 Like