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.FileName = workbook.Name;
dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm"; dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm";
if (dialog.ShowDialog() == DialogResult.Cancel) if (dialog.ShowDialog() == DialogResult.OK)
{
workbook.Close(false);
}
else
{ {
string fileName = dialog.FileName; string fileName = dialog.FileName;
workbook.SaveAs(fileName); workbook.SaveAs(fileName);