ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell is locked but still editable... (https://www.excelbanter.com/excel-programming/357562-cell-locked-but-still-editable.html)

[email protected]

Cell is locked but still editable...
 
Hi!
i am writing an Excel Addin, that retrives data from server and shows
it on a pre defined template.
i am trying to lock a spesific cell, according to data i retrived from
my server.
before data is entered to sheet, i protect the sheet using:

//i'm protecting the whole sheet
Range tempRange = ws.Cells;
tempRange.Locked = true;

Kaak[_60_]

Cell is locked but still editable...
 

Cells are locked to begin with.
You should unlock the cells you want to keep editing and then protect
the sheet.

Like:

Range("E19").Locked = False
ActiveSheet.Protect

Now you can only edit Cell E19

Kaak


--
Kaak
------------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513
View this thread: http://www.excelforum.com/showthread...hreadid=528052


[email protected]

Cell is locked but still editable...
 
thank you !
but i am trying to lock it not to unlock it...

Tomer



All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com