From b954844de9e6ab3f45ee90a67e900ba57ef74ec4 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Tue, 8 Feb 2022 16:10:45 +0300 Subject: [PATCH] Keep workbook open on save as dialog cancellation --- src/Interface/Dialog.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Interface/Dialog.cs b/src/Interface/Dialog.cs index 23f65d7..e6c7955 100644 --- a/src/Interface/Dialog.cs +++ b/src/Interface/Dialog.cs @@ -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);