Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 02, 2012 02:22 AM by panric
Member
20 Points
60 Posts
Jul 26, 2012 07:05 AM|LINK
HI All,
i created an excel file using System.IO. After creating the file,I am using following code to convert the file into native excel to redcue the file size while retaining the format.
try { app = new Application { Interactive = false, AlertBeforeOverwriting = false, DisplayAlerts = false, DisplayInfoWindow = false }; //Open previosuly saved workbook var workbook = app.Workbooks.Open(path); workbook.SaveAs(path, XlFileFormat.xlExcel12); workbook.Close(); }
The code is working fine but it is taking too long. Is there any way to reduce the time it is taking to generate file?
All-Star
15346 Points
3142 Posts
Jul 26, 2012 08:11 AM|LINK
whats the size of the file, and it also depends on the OS and hardware what you might do is implement
Task Parallel Library and do it Asynchronoulsy
46 Points
19 Posts
Jul 30, 2012 06:13 AM|LINK
I suggest you have a trial with Open XML Or use other 3rd party library like Spire.xls or Aspose.cells. This will promote the speed.
An article on Interop.Excel
Jul 31, 2012 06:24 AM|LINK
Hi Panric,
Thank you for your reply.Can you please suggest any free library.
Aug 02, 2012 02:22 AM|LINK
You may see this discussion on ASP.NET. It is talking about a free personal ExcelWriter.
webfriend13
Member
20 Points
60 Posts
Microsoft.Office.Interop.Excel.Application taking too long to save a file
Jul 26, 2012 07:05 AM|LINK
HI All,
i created an excel file using System.IO. After creating the file,I am using following code to convert the file into native excel to redcue the file size while retaining the format.
try { app = new Application { Interactive = false, AlertBeforeOverwriting = false, DisplayAlerts = false, DisplayInfoWindow = false }; //Open previosuly saved workbook var workbook = app.Workbooks.Open(path); workbook.SaveAs(path, XlFileFormat.xlExcel12); workbook.Close(); }The code is working fine but it is taking too long. Is there any way to reduce the time it is taking to generate file?
Mudasir.Khan
All-Star
15346 Points
3142 Posts
Re: Microsoft.Office.Interop.Excel.Application taking too long to save a file
Jul 26, 2012 08:11 AM|LINK
whats the size of the file, and it also depends on the OS and hardware what you might do is implement
Task Parallel Library and do it Asynchronoulsy
panric
Member
46 Points
19 Posts
Re: Microsoft.Office.Interop.Excel.Application taking too long to save a file
Jul 30, 2012 06:13 AM|LINK
I suggest you have a trial with Open XML Or use other 3rd party library like Spire.xls or Aspose.cells. This will promote the speed.
An article on Interop.Excel
webfriend13
Member
20 Points
60 Posts
Re: Microsoft.Office.Interop.Excel.Application taking too long to save a file
Jul 31, 2012 06:24 AM|LINK
Hi Panric,
Thank you for your reply.Can you please suggest any free library.
panric
Member
46 Points
19 Posts
Re: Microsoft.Office.Interop.Excel.Application taking too long to save a file
Aug 02, 2012 02:22 AM|LINK
You may see this discussion on ASP.NET. It is talking about a free personal ExcelWriter.