I want to catch "don't save" button click on save dialog when user is trying to close Excel workbook, but there are unsaved changes.
My case is: the user is opening the excel file changing something in the file and clicking to close button, the Excel application will display "do you want to save changes" dialog and I want to handle the cases when the user will choose no or cancel. I don't want to switch the screen and show to user my own dialog in my application, the user will not be happy for that solution. If there is a way to handle this please let me know.
Here is my code:
_xlsApp = new Excel.Application();
_xlsApp.WorkbookBeforeClose += new Excel.AppEvents_WorkbookBeforeCloseEventHandler(xlsApp_WorkbookBeforeClose);
_xlsApp.WorkbookBeforeSave += new Excel.AppEvents_WorkbookBeforeSaveEventHandler(xlsApp_WorkbookBeforeSave);