How to unload or close a spreadsheet

Posted by: evanbonnett on 8 September 2017, 3:24 pm EST

  • Posted 8 September 2017, 3:24 pm EST

    I just had to go back in time and work on a legacy app using windows forms and spread v 7.35.20142.0. I have a user control that is the container for the spread. The bug is this: When a user selects a value from a combo box, the code goes and loads up the entity the user selects. Once the entity is loaded, a collection is loaded into another list box. These are the spreadsheets that are available for the selection. The list box is loaded and the 0th element becomes active and is loaded into the user control that is the container for the spread.

    In the case where there aren't any spreadsheets for selection, the last one that was opened in the user control is left loaded, showing data that is inconsistent for the selection.

    Does anyone have an example of how to unload the currently opened spreadsheet and update the UI if necessary? I would think that this is a normal, easy thing to accomplish but in looking at the API, I don't really see anything intuitive. I have tried the reset methods and a few other things to no avail. The only thing that has remotely worked is to call Clear on the ActiveSheet property but that doesn't really unload the entire spreadsheet, AFAIK.

    Any help would be appreciated and Thanks!
  • Marked as Answer

    Replied 8 September 2017, 3:24 pm EST


    Normally the Reset should work. You could try SheetView.Reset for a specific sheet or SpreadView.reset.

Need extra support?

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

Learn More

Forum Channels