[Solved] Cell Protection following Data Refresh

Discuss the spreadsheet application
Post Reply
beersuser
Posts: 6
Joined: Tue Jun 12, 2018 4:10 pm

[Solved] Cell Protection following Data Refresh

Post by beersuser »

I have a spreadsheet containing 3 elements:
  • A formula that i want to protect.
    A data range that is pulled from a SQL database.
    A Button that calls a Macro to refresh said data.
I have unprotected the whole sheet, except for the cell containing the formula.

When I refresh the data range for the first time (either via the Macro or via Data > Refresh range), the data that is pulled in is automatically set to protected.

Subsequent attempts to update the data result in a 'Protected cells can not be modified' message.

Is there a way to ensure the data being pulled in is not automatically protected?

Best regards
Last edited by robleyd on Thu Sep 20, 2018 3:04 pm, edited 2 times in total.
Reason: Added green tick [robleyd, Moderator]
LibreOffice Version: 5.3.6.1 (x64)
Windows 10 Pro (x64)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Cell Protection following Data Refresh

Post by Villeroy »

menu:Data>Define...
select the database range in question
Click >Options
Check "Insert or delete cells". This makes sure that refreshed database ranges insert new cells as they grow and remove cells as they shrink. IMHO, this option is obsolete because it makes no sense to not set it. Same with option "Keep formatting" which refers to the formatting of the spreadsheet. You always want to keep any formatting of the output document.
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
beersuser
Posts: 6
Joined: Tue Jun 12, 2018 4:10 pm

Re: [Solved] Cell Protection following Data Refresh

Post by beersuser »

Thanks - worked a treat!
LibreOffice Version: 5.3.6.1 (x64)
Windows 10 Pro (x64)
Post Reply