From 1e91c34e465dd8a7f4f44307c874883b3569053d Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 30 Mar 2022 12:26:18 +0300 Subject: Revert "Turn off save as file dialog at the end of tool process. Version update." This reverts commit eaf3ebaa9489462e3d663c93df7a9bc34011464c. --- src/Interface/Dialog.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Interface') diff --git a/src/Interface/Dialog.cs b/src/Interface/Dialog.cs index 95d676f..e6c7955 100644 --- a/src/Interface/Dialog.cs +++ b/src/Interface/Dialog.cs @@ -36,5 +36,22 @@ namespace RehauSku.Interface else return null; } } + + public static void SaveWorkbookAs() + { + Workbook workbook = AddIn.Excel.ActiveWorkbook; + + using (SaveFileDialog dialog = new SaveFileDialog()) + { + dialog.FileName = workbook.Name; + dialog.Filter = "Файлы Excel (*.xls;*.xlsx;*.xlsm)|*.xls;*.xlsx;*.xlsm"; + + if (dialog.ShowDialog() == DialogResult.OK) + { + string fileName = dialog.FileName; + workbook.SaveAs(fileName); + } + } + } } } -- cgit v1.2.3