Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worksheet protection not preserved by loading/saving xlsx file #410

Closed
kainhofer opened this issue Aug 16, 2018 · 1 comment
Closed

Worksheet protection not preserved by loading/saving xlsx file #410

kainhofer opened this issue Aug 16, 2018 · 1 comment

Comments

@kainhofer
Copy link
Contributor

I have a workbook where the sheets are protected, so users can only edit explicitly unlocked cells. That worksheet protection is stored in the worksheet xml files using the XML element:

<worksheet [...]>
[...]
<sheetData>[...]</sheetData>
<sheetProtection selectUnlockedCells="1" selectLockedCells="1" scenarios="1" objects="1" sheet="1"/>
[...]
</worksheet>

Expected Behavior

Loading a file with worksheet protection with loadWorkbook and saving it again using saveWorkbook should preserve the protection of the worksheet.

Actual Behavior

Loading a file with worksheet protection with loadWorkbook and saving it again using saveWorkbook removes the protection of the worksheet.

Steps to Reproduce the Problem

2018-08-16_WorksheetProtection.xlsx

library(openxlsx)
wb = loadWorkbook("2018-08-16_WorksheetProtection.xlsx")
saveWorkbook(wb, "2018-08-16_WorksheetProtection.saved.xlsx")

sessionInfo()

  • Version of openxlsx: 4.1.1 (git master)
  • Version of R: 3.4.3 (2017-11-30)

This bug report is about the worksheet protection. The fact that the protection flag of individual cells is also lost, is already reported as a different bug #409 (since it concerns different settings and needs to be fixed differently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant