SaveExcel(stream, , ExcelFileFormat.XLS) takes 20 minutes and outputs corrupted file

Posted by: sharpdev on 10 September 2017, 10:56 am EST

  • Posted 10 September 2017, 10:56 am EST

    Dear all,

    I wonder if somebody could help us. We are evaluating the Silverlight spreadsheet component. We intended to use it as a
    part of our online excel files editing application.

    <span>Although we
    found user experience with the control very pleasing and close to original MS
    Excel experience, there is an issue with saving files back to disk after editing,<o:p></o:p></span>

    <span>The issue
    is with Excel2003 files. I attach the archive with one of the files
    we used to test. The file is named " original.xls ". We open this
    file in the Silverlight control with xlsGrid.OpenExcel(stream); method and
    it is displayed fine. Users can edit the cells, switch sheets, all looks very

    <span>But when I save
    modified document with xlsGrid.SaveExcel(stream, ExcelFileFormat.XLS); method,
    saving takes too long (15 to 20 minutes!!!!). When
    saving is done, we see that the file is corrupted (cell colors are different).
    Please refer to the corrupted.xls file inside the archive.<o:p></o:p></span>

    <span>Please advise.<o:p></o:p></span>


  • Replied 10 September 2017, 10:56 am EST


    Please explain, what you mean by "<span style="font-family:Tahoma, Arial, Helvetica;text-align:left;"> </span><span style="font-family:Tahoma, Arial, Helvetica;text-align:left;">can't reproduce this issue</span>". How long does it take to save the same file attached on your PC? Maybe we did something wrong or did not configure the web service?.. And also, are you saying that when you save the attached file with SaveExcel() the colors are not messed up? My inquiry is not about the output file size, but about 1) saving time 2) cells coloring lost.

    In the code we only enable/disable cells for editing based on color (cyan cells are enabled, other cells disabled). We don't change any styling and we remove all styling buttons, so users won't be able to change that either.

    Regards, Konstantin. 

  • Replied 10 September 2017, 10:56 am EST

    File size is reason why saving file is slow, I checked your corrupted file, there are more than 70,000 cell styles were generated in exported Excel file, but it works fine on my PC, only takes several seconds. And how do you enable/disable cells for editing base on color? Just change Locked property or cell? It would be good if you show me code of this part.
  • Replied 10 September 2017, 10:56 am EST

    Which version (assembly version number) do you use? And what do you do on the control between open and save the excel file? Do you meet the problem 
    only with this file, or you got same problem with any files?
  • Replied 10 September 2017, 10:56 am EST

    The version number is

    On the control I change values of different cells, say 10 cells on 5 sheets, 50 cells total.

    We face the same problem with different big binary Excel 2003 files, not just this one. And it looks like the saving time is the linear dependancy of the file size, i.e. 2.3M file takes 8-9 minutes to save.

    Regards, Konstantin. 

  • Replied 10 September 2017, 10:56 am EST

    I still can't reproduce this issue, export file will be smaller than original file after save from spread control, and even change value of tons cells. Is there some code in your application to operate spread control? for example change style of each cell or something like that.
  • Replied 10 September 2017, 10:56 am EST


    I attach the cut-down version of our application, the documents (input and output files) are located at the "docs" folder. I run the solution with VS2010 and IE8. I press "Open" and open the attached /docs/045_BNM_Reference_BI_FinancialReporting_FP_Monthly_Domestic_INV__V1.0-2011-07-01.xls file. I change cells on different sheets and press Save, choosing a different file name. Saving took ~15 minutes and output the result I attach under docs/045_output.xls . 

  • Replied 10 September 2017, 10:56 am EST

    Hi, kas

    I can see the issue by your code. And it is a problem of v1.0.3.0, and already be fixed in the latest version. You can get it work correctly in the next hot patch.

    And there is a simple workaround to avoid this issue, just remove line of code cell.Locked = true; in ApplyCyanRight method. It is unnecessary because default value of Locked property is just true. Without this line code, save file should be fast.

  • Replied 10 September 2017, 10:56 am EST

    Thanks a lot, Eric, 

    that solved the issue!


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels