OWC 11.0 in ASP.NET and C# to create excel file

S

sreedeeplal

I'm using OWC 11.0 in ASP.NET and C# to create excel file.

I need to protect/unprotect the sheet by a password. I tried to protect the
sheet by following code.




string Password = "Password123";
object getPasswordFromUser =(object)Password;
xl.ActiveSheet.Protect(ref getPasswordFromUser, ref obj,
ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj,
ref obj, ref obj, ref obj, ref obj, ref objTrue, ref obj);But it throws an
exception "Exception from HRESULT: 0xE0040059"

Kindly help me to resolve this issue. Code works well if I miss the password.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top