Resolved Saving DataGridView to Excel without saving file question

tim8w

Well-known member
Joined
Sep 8, 2020
Messages
129
Programming Experience
10+
Hi,
I was tasked with saving my DataGridView to Excel, which I did. Now the requirements have changed in that it has been requested to open the Excel File and let the user decide if they want to save it. I have done this as well, but I am wondering when, if ever, do I release the worksheet, workbook and app? I obviously don't know when the user quits excel.
 
If I recall correctly, one of the events you can register for on the Excel app object was a notification when the app was closing.
 
Release everything at your end right after opening the document. There's no reason for you to hold on, user will save or not, and close app.
 
Back
Top Bottom