|105015||Sep 3,2012 08:36 AM UTC||Sep 6,2012 11:31 AM UTC||Silverlight||3|
Hi Jaeyeol Shin,
Thank you for using Syncfusion products.
XlsIO doesn’t have any property or a method to check whether the file is encrypted or not. However, this can be achieved by an event “OnPasswordRequired” provided at its application level. This event will be raised if an encrypted file is tried to open without its password, where you can provide the password and proceed or else you can stop parsing the workbook.
The following code snippets helps you to achieve this.
private void btnCreateExcel_Click(object sender, System.EventArgs e)
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.OnPasswordRequired += application_OnPasswordRequired;
application.DefaultVersion = ExcelVersion.Excel2010;
IWorkbook workbook = application.Workbooks.Open(@"../../Data/Sample.xlsx", ExcelOpenType.Automatic);
IWorksheet sheet = workbook.Worksheets;
workbook.Version = ExcelVersion.Excel2010;
string fileName = @"../../Output/Output.xlsx";
catch (Exception ex)
void application_OnPasswordRequired(object sender, PasswordRequiredEventArgs e)
e.NewPassword = "syncfusion";
In addition, we have provided you a sample with the above code snippets for your reference in the following link.
Sample Link : EncryptedExcel.zip
Kindly refer to the provided solution and let us know whether the provided solution has resolved your issue or if you need any clarification.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.