Description: It seems like when using openpyxl to color a tab and then protect that sheet, when you open that document using libreoffice it loses its tab color. If you open it with another aplication like microsoft excel or google sheets the tab keeps that color. So I'm guessing it has nothing to do with openpyxl but with libreoffice calc since those atributtes are saved. Steps to Reproduce: 1.Use this code to create an example using python: from openpyxl import Workbook from openpyxl.styles import PatternFill # Create a new workbook and get the active sheet wb = Workbook() ws = wb.active # Assign a name to the sheet ws.title = "Main Sheet" # Change the color of the sheet tab ws.sheet_properties.tabColor = "1072BA" # Color should be in hexadecimal RGB format # Add some content to display in the sheet ws['A1'] = "This is an example of a sheet with a colored tab and protection." # Protect the sheet ws.protection.sheet = True ws.protection.password = 'my_password' # Save the file wb.save("colored_and_protected_sheet.xlsx") print("File created and protected successfully.") 2.Open it with libreoffice calc and see that the tab doesn't have a color. 3.Open it with another program and see that the tab does have a color. Actual Results: There's no color on the tab after it got protected. But there's is color if you use another program so the color atribute is saved. But for some reasons Libreoffice doesn't read it. Expected Results: To see the tab colors even if the sheet is protected. Reproducible: Always User Profile Reset: No Additional Info: If you try to do it ussing the app (Libreoffice calc) you can put a color and then protect the sheet. It'll save the tab color. But not using openpyxl.
Created attachment 196726 [details] Script in python for testing. It creates the file you need to check. You will see that in libreoffice the tab won't have a color but in other aplications will.
Reproduced using LibreOffice instead of Python This happens in xlsx but not in ods. Duplicate? https://bugs.documentfoundation.org/show_bug.cgi?id=122945