I needed to copy sheets from another workbook, to the Excel Document Level AddIn which I am working in. I have used the following code to open the Excel file selected :-
Dim workbook As Excel.Workbook = Globals.ThisWorkbook.Application.Workbooks.Open(OpenWorkSheetDialog.FileName) workbook.IsAddin = True (IsAddin is set to true so that the new Workbook opened does not open up a new Excel Window)
However, during the workbook.close() method call, I am always getting the "Do you want to save the changes to ..." Excel dialog box.
workbook.Close(SaveChanges:=False)
Please let me know, how I can prevent the appearing of this dialog box and close the file. I have tried setting DisplayAlert = False and ScreenUpdating = False.