aboutsummaryrefslogtreecommitdiff
path: root/src/Forms
diff options
context:
space:
mode:
Diffstat (limited to 'src/Forms')
-rw-r--r--src/Forms/Dialog.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Forms/Dialog.cs b/src/Forms/Dialog.cs
index 170cc81..cc1c29a 100644
--- a/src/Forms/Dialog.cs
+++ b/src/Forms/Dialog.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Microsoft.Office.Interop.Excel;
+using System.Collections.Generic;
using System.Windows.Forms;
namespace RehauSku.Forms
@@ -42,5 +43,20 @@ namespace RehauSku.Forms
return fileNames.ToArray();
}
+
+ public static void SaveWorkbookAs()
+ {
+ Workbook wb = AddIn.Excel.ActiveWorkbook;
+ string currentFilename = wb.FullName;
+ string fileFilter = "Файлы Excel (*.xls;*.xlsx;*.xlsm),*.xls;*.xlsx;*.xlsm";
+
+ object fileName = AddIn.Excel.GetSaveAsFilename(currentFilename, fileFilter);
+
+ if (fileName.GetType() == typeof(string))
+ wb.SaveAs(fileName);
+
+ else
+ wb.Close(false);
+ }
}
}