Closed DIPAD-Fran-Bryden closed 11 months ago
Hi @DIPAD-Fran-Bryden , afaik the information is simply not available in openxlsx style objects. The entire styles.xml file is imported into style objects and exported when saving. The style name is in <cellstyles>...
or similar, which is not necessary for openxlsx. I guess it would be possible to add this, but might require a larger patch. You can have a look at the in development package openxlsx2, which has a different logic of handling styles. It should preserve all styles.
Edit: Didn't want to close this, even though it's unlikely to be picked up.
Cheers @JanMarvin, really appreciate the helpful response! Will check out openxlsx2 as an alternative 😺
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Describe the bug When opening an existing xlsx file containing header styles in cells and then resaving it, the appearance of the cell is preserved, but the naming of this style as a header style (e.g. Heading 1 or Heading 2) is lost. This is necessary for accessibility of xlsx documents with technology such as screen readers.
To Reproduce
wb <- loadWorkbook("test_heading.xlsx")
openxlsx::saveWorkbook(wb, "test_heading.xlsx")