excel4node icon indicating copy to clipboard operation
excel4node copied to clipboard

Password protection for file

Open hansiemithun opened this issue 9 years ago • 9 comments

First of all i would thank you for an awesome library :) Is there any way of generating an excel with password protection. Also read an file with password given for those. Awaiting for your response author

hansiemithun avatar Sep 23 '15 12:09 hansiemithun

There are two kinds of workbook password protections. There is the "Password to open" and "Password to modify". The password to modify is pretty easy to implement as it just adds a few attributes to the workbook XML files. I just pushed a commit into the dev branch that adds the ability to protect a workbook and worksheets from modification. The "Password to open" actually changes how the whole structure of the xlsx file and encrypts the data within the Excel workbook. That is a much larger undertaking. If you were asking for the password to modify option, go ahead and clone the dev branch and see if this will work for you. If you were asking for the password to open option, it may be a while before I can get that added. Right now, the excel4node module does not have the ability to read in a file at all, much less a password protected one. That is already listed as an enhancement issue, though.

natergj avatar Sep 24 '15 22:09 natergj

Thanks for the consideration. By default wb.write(filename); generates xlsx without any password. I was looking for generating xlsx file with password optionally. And read the same file giving password from app itself. Modifying password is also a good one. Could you please brief in detail with an example in readme about this. And one more thing is can you please give an example of border creation. I am trying something like : I have changed a bit when i working in dynamic population as per the requirement. And cell.Format.Fill.Color(color); // works with the existing feature provided,

But cell.Format.Border({ top:{ style:'thin', color:'CCCCCC' }, bottom:{ style:'thick' }, left:{ style:'thin' }, right:{ style:'thin' } });

throwing error as Border function undefined. Please correct me if i am doing wrong with an simple example for this as well

hansiemithun avatar Sep 25 '15 08:09 hansiemithun

oK. I'll keep this issue open until I can add the ability to add "Password to open" Please open new issue for the Border item rather than adding it to this chain.

natergj avatar Sep 25 '15 12:09 natergj

Password to open is still missing ?

jiacai2050 avatar Jul 28 '16 01:07 jiacai2050

Can we lock/unlock selected cells. I want to protect entire sheet except few columns/cells should be editable

Bhawnananda avatar Jun 22 '17 10:06 Bhawnananda

Hi @Bhawnananda did you ever find a solution for this

zubinAntuit avatar Dec 15 '17 20:12 zubinAntuit

Is there any movement on this? @natergj My team and I at FormHero would be interested in contributing.

Could you point us in the right direction as far as where you think changes will need to be made and any specifications around the password protection in the XLSX spec?

ryan-kimber avatar Mar 21 '19 12:03 ryan-kimber

It looks like the encrypted workbooks are stored in the same OLE format at the old xls documents. I don't think to add encryption support is going to be a straight forward process. "password protected" is a bit ambiguous when it comes to xlsx. It is fairly straight forward to "protect" a workbook from edits, but encryption is a different story.

natergj avatar Mar 25 '19 21:03 natergj

hi, I want to protect the entire sheet except for a few columns. How can I do it? Please guide?

sumitbhavra avatar Oct 13 '19 03:10 sumitbhavra