Keep workbook open on save as dialog cancellation

This commit is contained in:
Sergey Chebotar 2022-02-08 16:10:45 +03:00
parent 14a1225462
commit b954844de9

View File

@ -46,12 +46,7 @@ namespace RehauSku.Interface
dialog.FileName = workbook.Name;
dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm";
if (dialog.ShowDialog() == DialogResult.Cancel)
{
workbook.Close(false);
}
else
if (dialog.ShowDialog() == DialogResult.OK)
{
string fileName = dialog.FileName;
workbook.SaveAs(fileName);