Suddenly unable to leave a column of cells unlocked before adding protection to a sheet.

23367494 0 Reputation points
2023-12-20T16:44:54.3566667+00:00

In the last couple weeks Excel online has been unable to recognize my office script for leaving a column of cells unlocked and therefore editable after I password protect the sheet. The cells that should be unlocked in Excel online give this error, "This sheet is protected. Some parts may be view-only and can't be changed. The user now has to download the sheet to desktop app to be able to edit the unlocked cells on the protected sheet.

This script worked perfectly up until 12/10/2023. What changed?

Here is the script that was used:

sheet.getRange("F:F").getFormat().getProtection().setLocked(false);
sheet.getProtection().protect({ allowFormatColumns: true,}, "*******");
Microsoft Office Online Server
Microsoft Office Online Server
Microsoft on-premises server product that runs Office Online. Previously known as Office Web Apps Server.
639 questions
Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,633 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,896 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal Lee Morgan 390 Reputation points
    2023-12-20T16:49:08.6966667+00:00

    It seems like you are facing an issue with Excel online not recognizing your Office script for leaving a column of cells unlocked and editable after password-protecting the sheet. The cells that should be unlocked are giving an error message, “This sheet is protected. Some parts may be view-only and can’t be changed.” This issue can occur due to permission issues or syncing problems <sup>123</sup>.

    To resolve this issue, you can try the following steps:

    1. Check if the desktop folder is synced with OneDrive. If it is not synced, you can try syncing it again.
    2. Check if the desktop folder is selected for backup in OneDrive settings. If it is not selected, you can select it and try syncing it again.
    3. Check if the desktop folder has the necessary permissions. You can try giving your user account full control over the desktop folder <sup>1</sup>.
    4. Try resetting OneDrive and then restarting it. This can help clear the cache and resolve any syncing issues <sup>3</sup>.

    If the above steps do not resolve the issue, you can try reaching out to the OneDrive support team for further assistance.

    I hope this helps! Let me know if you have any other questions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.