https://bugs.documentfoundation.org/show_bug.cgi?id=163168
Bug ID: 163168
Summary: Sheet tab color not displayed correctly in LibreOffice
when generated with Python libraries
(xlsxwriter/openpyxl) after applying protection
Product: LibreOffice
Version: 24.2.0.3 release
Hardware: x86-64 (AMD64)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
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.
--
You are receiving this mail because:
You are the assignee for the bug.