Questions tagged [spreadsheet-protection]

Use for questions about programmatically interacting with inbuilt protections in any spreadsheet. Use with appropriate spreadsheet software tag like [excel], [google-sheets], [libreoffice-calc], [openoffice-calc] and the language tag like [python], [google-apps-script]. Do NOT use for non-programmatic usage.

Protection is a inbuilt feature in most spreadsheet software, where some parts of the spreadsheet like sheet or range can be protected from unwanted edits from users.

Feature Reference:

54 questions
8
votes
1 answer

Protect ranges with google apps script

I have a number of sheets which I need to protect except for certain ranges. Is it possible to do this with a script, as I have several sheets, and many ranges within the sheet which I need to be unprotected so staff can edit the sheets. The ranges…
Matt
  • 165
  • 2
  • 3
  • 13
6
votes
3 answers

userinterfaceonly:=true doesn't seem to allow VBA changes to conditional formatting?

I'm running a piece of code via the Worksheet_Change Event and I have it working with a call to an unprotect sub at the beginning of the event and a matching call to a protect sub at the end of the event. This works as expected. I'm trying to work…
5
votes
1 answer

sheet.getProtections no longer works?

I have a script that automatically protects a range of past Dates in my Sheet. I use the standard sheet.getProtections(SpreadsheetApp.ProtectionType.RANGE); It worked fine for several months but it has not worked since yesterday. Is there any…
5
votes
1 answer

Temporarily run script as another user

I have a Google Spreadsheet containing a number of sheets, each or which I have protected using the "Except certain cells' routine in order to protect shared users from editing areas they shouldn't. I also have a function to insert rows but this…
5
votes
1 answer

Workbook.Protect bug with toggling protection

When I call Thisworkbook.Protect in VBA the protection of the workbook actually toggles from the current workbook's protection status instead of just protecting the workbook. Thisworkbook.Unprotect doesn't do this though. Anyone know why this is the…
KingKong
  • 411
  • 3
  • 10
  • 26
5
votes
4 answers

Protect Excel Worksheet For Read Only But Enable External Data Refresh

I have an Excel 2010 workbook. One worksheet imports data from an external data connection (SQL query). I have also added additional columns to the worksheet to perform calculations on the data and to massage it a bit. The worksheet forms the…
Dominic
  • 587
  • 3
  • 9
  • 19
4
votes
1 answer

Sorting Protected Cells Using PHPExcel

I have a spreadsheeet outputted from PHPExcel, and everything displays perfectly. I have protected the sheet as follows: $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); which works fine. In the sheet I have a table, in which some…
Warren Sergent
  • 2,542
  • 4
  • 36
  • 42
4
votes
1 answer

Using VBA to unprotect cells

So I have a spreadsheet that I want to format based on user inputs, but the cells need to remain locked until it is determined by the formatting that they will be user input cells. I have code that will look the cells for the user interface only but…
Karen Hornsby
  • 43
  • 1
  • 1
  • 3
3
votes
1 answer

How can I lock editing permissions in Google Sheets using Google Scripts, based on cell color AND continent?

I can lock by color, but need to also to lock only the white cells (ffffff) that contain any content. var ss = SpreadsheetApp.getActiveSpreadsheet(); //clears green feilds var sheet = ss.getSheetByName("Sheet1"); var color =…
3
votes
1 answer

Workbook Protection is unprotected regardless of password (VBA Excel 2010)

I searched about the said problem with various keywords but all results were either related to how to protect a workbook or unprotect it without knowing the password. My current problem is not really a big problem but it feels so weird that I want…
valefore
  • 31
  • 2
3
votes
1 answer

Protecting and Hiding Columns same as "Very Hidden" Sheets

I am trying to hide some columns and prevent the user to have any access to them; while they can edit other parts of the sheet. What I am seeking is something like: ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden So user cannot see them.…
M--
  • 25,431
  • 8
  • 61
  • 93
3
votes
1 answer

How to search for and delete named protected range in Google Sheets?

I am am writing a script in Google Sheets that selectively locks a large block of cells, and each day will need to include one more row of cells into that same protected range. The script is working so far, in terms of locating the rows that need…
3
votes
1 answer

Remove error indicating unlocked cells are protected with VBA

I have a template sheet that is copied through VBA into a new sheet. The new sheet is added by clicking on a button that makes a userform pop up, and the information in the userform is transferred to the new sheet. This new sheet contains locked…
DSG
  • 115
  • 1
  • 2
  • 8
3
votes
2 answers

Protect shapes so users can modify but not delete

I have a workbook with some shapes that I don't want users to delete easily. They are linked with an index, and the index number is linked with a whole other bunch of stuff. However, the user needs to move the shapes around and resize them. How can…
mcallagain
  • 31
  • 1
  • 1
  • 3
2
votes
4 answers

Worksheet protection set using ws.protect - but doesnt unprotect using the Menu (Review - Unprotect sheet)

I have the following code to protect the sheets of a workbook in Excel 2007 Private Sub password_protectallsheets() For Each ws In Worksheets ws.protect Password = "edc1" Next End Sub but when I try to unprotect the sheet using the password through…
ashleych
  • 1,042
  • 8
  • 25
1
2 3 4