I am looking for how to assign the option to save workbook to a button. as the image
Try this but it does not save the current workbook, it only generates a new one.
var saveDialog = new SaveFileDialog() //create new instance of savefiledialog
{
Title = "Save As", //sets title of dialog box
Filter = "Excel Worbook (*.xlsx)|*.xlsx", //filter for .xlsx files
AddExtension = true, //automatically adds the .xlsx extension
CheckPathExists = true //checks if the given path really exists
}
if (saveDialog.ShowDialog() == DialogResult.OK)
{
Globals.ThisAddIn.Application.ActiveWorkbook.SaveCopyAs(saveDialog.FileName);
}