Getting File Repair Alert in Excel

<w:LatentStyles DefLockedState=“false” LatentStyleCount=“156”>
</w:LatentStyles>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

<![endif]–>

Hi,

We are evaluating aspose.cell for .net, we have existing excel templates in our project. Each template is having two sheets in it i.e. summary and account data sheet. We are writing data to account detail sheet by using the aspose.cells. Summary sheet contains a Pivot table and it is getting generated based on generated account detail sheet.

In code first we are copying existing template to a temp file then writing the data to account detail sheet by using Aspose then saving the same temp file by using below line of code:

AsposeExcelWorkBook.Save(strFilePath,SaveFormat.Excel97To2003)

then in next step we are sending the file to browser with below lines of code:

Response.Clear();
Response.ContentType = "application/x-msexcel";
Response.AddHeader("Content-Disposition", "inline; filename=Report.xls");
Response.WriteFile(strFilePath);
Response.End();

Now when we open the generated file in excel we are getting repair alert box and a message as below:

Microsoft Office Excel File Repair Log

Errors were detected in file 'some file path'
The following is a list of repairs:

Repairs were made to PivotTable report 'PivotTable1' on '[Report.xls]SUMMARY'.

Any suggestions in this regards will be really helpful.

Thanks in advance.

Regards,
Sandeep Newad

Hi,

When you open the saved file at strFilePath in MS Excel, does it work fine opening it into MS Excel without any errors?

If you want to send the file to client browser, you may try the line of code:

AsposeExcelWorkBook.Save(this.Response, “Report.xls”, ContentDisposition.Inline, new XlsSaveOptions());



I have also attached our latest version/fix v5.2.1.1. Please try it, if you still find the issue, kindly do create a sample project, zip it and post it here to show the issue. We will check it soon.

Thank you.

Hi Amjad,

It is working fine now.

Thank you.