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,
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"); }
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.
I just want to let you know that you can download the latest service release from your account.
yes please do!
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.