FlexGrid Export to Excel Crashes App If Excel File Exists

Posted by: danieldoucette on 10 June 2021, 2:24 am EST

  • Posted 10 June 2021, 2:24 am EST

    Using a FlexGrid version 4 in a WinForm app running .NET Framework 4.7.2

    This is the method I use
    cflxFleetDeliveries.SaveExcel(strFileName.ToString, "Fleet", C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells Or C1.Win.C1FlexGrid.FileFlags.VisibleOnly Or C1.Win.C1FlexGrid.FileFlags.AsDisplayed)


    If I export to a new file it works fine. If the file already exists (not open by anyone) it crashes and corrupts the file. I have error handling around the above command and it should produce a message box for any errors.

    Any ideas?
  • Replied 10 June 2021, 6:20 pm EST

    Hello Daniel,

    We do not face the issue at our end with the latest builds 4.0.20211.492 and the file is saved without any problem. Can you please let us know the version that you are using at your end?

    I request you to upgrade your controls to 4.5.2 FW as 4.0 has been in maintenance mode for too long.
    https://www.grapecity.com/forums/winforms-edition/net-40-and-20-support-noti_1

    Regards,
    Prabhat Sharma.
  • Replied 10 June 2021, 11:02 pm EST

    I'm using version 4.0.20152.74

    I would upgrade but this is legacy software and would require regression testing to make sure there were no other adverse side effects. Also, we have many legacy applications using this version of the flex grid and if I need to fix small bugs in them I could cause issues with those as well.

    We have a work-around for now. As long as we save to a new file it works fine, it only seems to crash when we save to the same file over again.
  • Replied 14 June 2021, 8:47 pm EST

    Hello Daniel,

    We do not face the issue with the exported excel file when using 4.0.20152.74 builds.
    Please find the attached sample implementing the same and modify it accordingly to replicate the issue.

    Regards,
    Prabhat Sharma.
    FlexGridExportVB.zip
Need extra support?

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

Learn More

Forum Channels