Is it possible to save excel workbook in vsto c #?

1

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);
}
    
asked by Luis angel Alvarado Hernandez 07.08.2018 в 20:53
source

0 answers