Hi, I am using the open xml sdk2.0 to create a excel spreadsheet. I want to add the <SheetProtection> to avoid user change some cells.
Becuase the password is different for each excel file creating from system. So I wil dynamic assign password when create SpreadSheet XML.
How can I get the correct MICROSOFT EXCEL encrypt password.
ex: In Excel when user set password: ABCD , in XML wll be <sheetProtection password="C99D">
Is any way to follow the EXCEL algorithm to give the correct password?
This my c# code:
SheetProtection addProtection = new SheetProtection()
{
Password = "C99D",
//AlgorithmName = "SHA-1",
//HashValue = "85ce6b4df042c1025e694c47c30f498e34ac75f2",
Sheet = true,
Objects = true,
Scenarios = true,
AutoFilter = false
};
Thanks.
BR
Tom
ex: