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

Implement protectRange() #421

Closed
wants to merge 0 commits into from
Closed

Conversation

DavisVaughan
Copy link

@DavisVaughan DavisVaughan commented Sep 13, 2018

This PR implements the protectRange() function. It supersedes #412. It protects an Excel range so that when a worksheet is protected with protectWorksheet(), specific ranges are still editable with or without a password specific to that range.

Note that this only works properly on a Windows version of Excel. On Mac, there is no UI window for protecting ranges. That said, on my Mac, I can use protectRange() without a password and it leaves the range open for editing when i lock the rest of it with protectWorksheet(). If I use a password, I get a strange "Activate" window that pops up when I try to edit the cells, and when I click okay it gives me an error saying I typed in the wrong password. I've made a note in the docs saying it only works properly on Windows.

There are no checks that the range is in a correct Excel format. If an incorrect format is supplied, upon opening the Excel workbook Excel will complain and ask if you want to remove the faulty XML. If you say yes, it will remove the protected range (in fact I think it removes all of them?).

It is meaningful for overlapping ranges to be protected with multiple passwords. See the documentation Details section for more info.

I see this PR being useful when creating data entry templates with R. A data scientist could create a boxed off "holy grail" sheet / range where an analyst can enter data and then pass it back to the data scientist for further munging. The protection prevents the analyst from entering data in cells that could cause the data scientist issues.

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

Successfully merging this pull request may close these issues.

None yet

1 participant