Is there any way to add a password to an Excel file that I am going to save? I would like to use your Excel classes, but if I MUST use Interop to add the password, this defeats the purpose of not using Interop and having to have Excel installed alongside my WPF application
Hi Travis,
This functionality currently is not supported. Please read the following reason why we can’t add this functionality yet:
http://es.infragistics.com/community/forums/p/29829/261375.aspx#261375
But you can vote for this Product idea here.
wow how come other companies can offer this feature then? This makes my use of your Excel component worthless - very disappointing
Hi,
I just got news that this feature is implemented and will be included in the next Service Release that is expected to be available in two weeks. I can update you when you will be able to download it.
yes please do!
I just want to let you know that you can download the latest service release from your account.
Can you tell me how to do add the password? I upgraded to the newest service pack. An example or something, I don't see any documentation, or this mentioned in the release notes.
You can use the method : SetFileWriteProtectionPassword of the Workbook
Workbook
Here is the example:
Workbook myBook = exporter.Export(xamDataGrid1, Infragistics.Documents.Excel.WorkbookFormat.Excel2007); myBook.SetFileWriteProtectionPassword("yourPassword"); myBook.Save("TEST.xlsx");
Or you can use the method in any of the excel exporting event to set the password like: void exporter_RecordExporting(object sender, RecordExportingEventArgs ){e.Workbook.SetFileWriteProtectionPassword("yourPassword"); }
void exporter_RecordExporting(object sender, RecordExportingEventArgs ){e.Workbook.SetFileWriteProtectionPassword("yourPassword"); }