The error is -
__Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password__
Here is the process:
1. My application opens a blank version of this file using EPPlus, populates the sheets, adds sheet protection, then saves as a different file name. The blank version of the file was created using Excel 2013.
2. Users are expected to enter more data in the unprotected sheets and then save it and send it back to us.
3. The application opens it again using EPPlus and does some more edits before processing.
This all works when editing the file in Excel 2013. However, if step #2 is done by a user with Excel 2007, step 3 raises the error mentioned at the top. I can open and resave the file in Excel 2013 and everything works fine. Or, the worksheet protection can be removed in excel and resaved and it works fine.
__So basically, if a file uses workbook protection and it is saved using Excel 2007, EPPlus cannot open it.__
The code I'm using to open the file is (in VB.NET):
Dim strFromFile As String = "[file name]"
Dim oXLFrom As New ExcelPackage(New System.IO.FileInfo(strFromFile)) __<--The error is raised with this line__
Can someone advise on something that can help with this? I really would like to be able to leave all of the workbook protection in place with these files if possible. Due to the potentially sensitive nature of the contents of my file, I would prefer not to attach it to this public forum. I can send it in a private message or email it to any developer that can look at it though.
__Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password__
Here is the process:
1. My application opens a blank version of this file using EPPlus, populates the sheets, adds sheet protection, then saves as a different file name. The blank version of the file was created using Excel 2013.
2. Users are expected to enter more data in the unprotected sheets and then save it and send it back to us.
3. The application opens it again using EPPlus and does some more edits before processing.
This all works when editing the file in Excel 2013. However, if step #2 is done by a user with Excel 2007, step 3 raises the error mentioned at the top. I can open and resave the file in Excel 2013 and everything works fine. Or, the worksheet protection can be removed in excel and resaved and it works fine.
__So basically, if a file uses workbook protection and it is saved using Excel 2007, EPPlus cannot open it.__
The code I'm using to open the file is (in VB.NET):
Dim strFromFile As String = "[file name]"
Dim oXLFrom As New ExcelPackage(New System.IO.FileInfo(strFromFile)) __<--The error is raised with this line__
Can someone advise on something that can help with this? I really would like to be able to leave all of the workbook protection in place with these files if possible. Due to the potentially sensitive nature of the contents of my file, I would prefer not to attach it to this public forum. I can send it in a private message or email it to any developer that can look at it though.