Hi All!
My problem is -- __loaded and saved back xlsx-file can not be loaded__ by Excel (v. 2010) because of Excel application founds __unreadable content__ and proposes to __recover the contents of the workbook__.
Used EEPlus v2.0.50727.
The following code can be used to demonstrate the problem:
```
public class App
{
public static void Main(string[] args)
{
// Check args -- [0] is input file name; [1] -- output file name
if (args.Count() != 2)
return;
var pkg = new ExcelPackage();
// Load file
using (var inputStream = new FileStream(args[0], FileMode.Open))
pkg.Load(inputStream);
// Save file
using (var outStream = new FileStream(args[1], FileMode.Create))
pkg.SaveAs(outStream);
Console.WriteLine("Done loading xls file from \"{0}\" and writing a copy to \"{1}\"", args[0], args[1]);
}
}
```
Produced file passes the validation by "Open XML SDK 2.5 Productivity Toll for Microsoft Office" without errors (for any validation option). But when opened by Microsoft Excel and repaired, then error052280_01.xml file contains info about two repaired records:
```
<repairedRecords summary="Following is a list of repairs:">
<repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet8.xml part</repairedRecord>
<repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet9.xml part</repairedRecord>
</repairedRecords>
```
Source xlsx-file causing the described error (being opened and saved back) is attached.
Where and how to find incorrect contents in the produced file?
Any thought are appreciated.
Thanks!
My problem is -- __loaded and saved back xlsx-file can not be loaded__ by Excel (v. 2010) because of Excel application founds __unreadable content__ and proposes to __recover the contents of the workbook__.
Used EEPlus v2.0.50727.
The following code can be used to demonstrate the problem:
```
public class App
{
public static void Main(string[] args)
{
// Check args -- [0] is input file name; [1] -- output file name
if (args.Count() != 2)
return;
var pkg = new ExcelPackage();
// Load file
using (var inputStream = new FileStream(args[0], FileMode.Open))
pkg.Load(inputStream);
// Save file
using (var outStream = new FileStream(args[1], FileMode.Create))
pkg.SaveAs(outStream);
Console.WriteLine("Done loading xls file from \"{0}\" and writing a copy to \"{1}\"", args[0], args[1]);
}
}
```
Produced file passes the validation by "Open XML SDK 2.5 Productivity Toll for Microsoft Office" without errors (for any validation option). But when opened by Microsoft Excel and repaired, then error052280_01.xml file contains info about two repaired records:
```
<repairedRecords summary="Following is a list of repairs:">
<repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet8.xml part</repairedRecord>
<repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet9.xml part</repairedRecord>
</repairedRecords>
```
Source xlsx-file causing the described error (being opened and saved back) is attached.
Where and how to find incorrect contents in the produced file?
Any thought are appreciated.
Thanks!