We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel can not able to open the file...

Thread ID:

Created:

Updated:

Platform:

Replies:

121309 Nov 30,2015 08:39 AM UTC Dec 8,2015 05:16 AM UTC ASP.NET Web Forms 2
loading
Tags: XlsIO
Suresh Thota
Asked On November 30, 2015 08:39 AM UTC

Hi Team,

Thank you very much for your mails.


Some how I have managed to execute an application. But now, excel can not able to open the file.

Please find the attached document, which contains the the steps, whatever I am following in source code.

Requesting you, kindly give me the solution for this issue.


Regards,
Suresh Thota

Attachment: MyAtt_a9d2d5e5.zip

Ishwarya Narayanan [Syncfusion]
Replied On December 1, 2015 11:49 AM UTC

Hi Suresh, 

This error occurs when there is mismatch between the file format and its extension. This can be resolved by setting workbook version set to the required version.

 

·         To save a workbook in Excel2003 format, set the workbook version to Excel97to2003 and save the file with extension ‘.xls’ i.e. binary file format.

·         To save a workbook in Excel 2007/Excel2010/Excel2013 formats, set the workbook version to Excel2007/Excel2010/Excel2013 respectively and save the file with extension ‘.xlsx’ i.e. open xml file format.

 

The below code example illustrates the same.

string fileName = Server.MapPath("App_data/Sample.xls");

IWorkbook workbook = application.Workbooks.Open(fileName, ExcelOpenType.Automatic);

           

IWorksheet sheet = workbook.Worksheets[0];

workbook.Version = ExcelVersion.Excel2007;

 

workbook.SaveAs(this.TextBox1.Text + ".xlsx", ExcelSaveType.SaveAsXLS, Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2007);

 

 

We have provided a sample as per your scenario in the below link for your reference. Kindly try with this and let us know.

 

Sample Link:

http://www.syncfusion.com/downloads/support/directtrac/general/ze/XlsIO_Sample226675246.zip

 

Please let us know if you need any clarification. 

Regards,

Ishwarya N


Rilfanayasmin Jamal Nasar [Syncfusion]
Replied On December 8, 2015 05:16 AM UTC

From: suresh thota [mailto:suresh_thota@yahoo.com]
Sent: 12/02/2015 01:22 AM
To: Syncfusion Support <support@syncfusion.com>
Subject: Re: Syncfusion support community forum 121309, Excel can not able to open the file..., has been updated.


Hi Team,


Thank you for your reply.


Yes. I have seen from one the the SyncFusion URL. Its working now.


Thank you very much for your support.




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;