[Issue] Disable selection of protected cells

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
cheviot
Posts: 2
Joined: Thu May 29, 2014 1:07 am

[Issue] Disable selection of protected cells

Post by cheviot »

I created a Calc spreadsheet that contains protected and unprotected cells (the
protection is simply to avoid casual mistakes.) I then password protected the
sheet, setting the attribute that disables user selection of protected cells.
All this done via the Calc GUI.

I then wrote a Basic macro to manipulate the spreadsheet. The macro removes
the sheet protection, manipulates the sheet and finally reapplies the sheet
protection. However, the macro sheet protection does not honour the originally
applied "disable user selection of protected cells" attribute. Is it possible for a
Basic macro to disable user selection of protected cells? If so, then how can this
be done?

The relevant code I am using is:-

Code: Select all

Dim Sheet As Object
Sheet = ThisComponent.getcurrentcontroller.activesheet

Sheet.unprotect("mypasswd")

Sheet.protect("mypasswd")
I'm a beginner in writing Basic macros and a google search and a forum search on macro
sheet protection didn't produce anything useful.
Last edited by Hagar Delest on Thu May 29, 2014 11:53 am, edited 1 time in total.
Reason: tagged the thread as Issue (link to a bug report).
OpenOffice 4.1.0 on Windows 7
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Sheet protection - disable selection of protected cells

Post by B Marcelly »

Hi,
According to Bug 123703 (confirmed) :
  • Option "Select locked cells" does not survive a document reload.
  • This feature was introduced in AOO 4.0.0.
    However I could not find it described in AOO 3.4 Release Notes
The "Select locked cells, Select unlocked cells" items have not been added in the help pages descriptions of sheet protection.
I could not find the equivalent in API (nothing in the IDL description, nothing using Xray).

In my opinion, this is a not finished, not debugged, not documented feature. No wonder the API aspect is missing.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
cheviot
Posts: 2
Joined: Thu May 29, 2014 1:07 am

Re: Sheet protection - disable selection of protected cells

Post by cheviot »

Many thanks for your reply. Much appreciated.
Perhaps there will be a future fix for this. I
live in hope.
OpenOffice 4.1.0 on Windows 7
ricaltman
Posts: 7
Joined: Sat Dec 14, 2019 7:27 pm

Re: [Issue] Disable selection of protected cells

Post by ricaltman »

5 years and no fix
Openoffice 4.1.7 on MacOS Mohave 10.14.6
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Issue] Disable selection of protected cells

Post by Villeroy »

Works fine with https://libreoffice.org/
It will never be fixed in OpenOffice.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply