Reply to topic  [ 2 posts ] 
Formatting Unlocked Cells 
Author Message

Joined: Tue Mar 11, 2008 1:30 am
Posts: 1
Reply with quote
Post Formatting Unlocked Cells
If I protect a worksheet and then unlock certain cells, I can edit those cells in Excel, but I can't format them (format options are disabled). Specifically I want the user to be able to change the foreground and background.

When protecting a worksheet manually you can specify what actions a user can take on the protected sheet. So, I could manually specify that a user can format cells, but can't select locked cells. That would be perfect.

Is there any way of doing this in code?

Example Javascript code;

var sheet;
var table;
var xls = Server.CreateObject("EasyXLS.ExcelDocument");

xls.easy_addWorksheet_2("Sheet1");
sheet = xls.easy_getSheetAt(0);
sheet.setSheetProtected(true);

table = sheet.easy_getExcelTable();
table.easy_getCell(0, 0).setLocked(false);
table.easy_getCell(0, 0).setValue('Kevin');
table.easy_getCell(0, 1).setValue('Kirk');

xls.easy_WriteXLSFile('test1.xls');
xls.Dispose();


Tue Mar 11, 2008 6:09 am
Profile

Joined: Wed Nov 07, 2007 4:42 am
Posts: 67
Reply with quote
Post Formatting Unlocked Cells
EasyXLS usually preserves as much unknown features as possible when loading a document, edit it and save it back. The Protection with Format cells option set is one of them. You can create a template, load it and then write it with a different name. The template can be an xls file that has the sheet protected with Format cells option set.


Tue Mar 11, 2008 12:03 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.