We save an Excel file after creating it. We have many methods to save an Excel file, which is often called workbook. Generally, workbook will be saved in the current folder with the name it was given when it was created if we don’t save it by specifying a path. Also, we can save a copy of the workbook without modifying the open workbook in memory.

The first way is to save a workbook without changing the path associated with a document-level customization.

Call the Save method of the ThisWorkbook class in C#:

this.save();

Save the active workbook in an application-level add-in.

Call the Save method to save the active workbook in C#:

this.Application.ActiveWorkbook.Save();
The other way is to save a Workbook with a new path associated with a document-level customization.

Call the C# Excel SaveAs method of the ThisWorkbook class.

Save the active workbook in an application-level add-in

Call the SaveAs method to save the active workbook to a new path in C#.

The third way is to save a copy of the workbook without modifying the open workbook in memory associated with a document-level customization

Call the SaveCopyAs method of the ThisWorkbook class in C#:

This.SaveCopyAs(@ “C:\Book1.xls”);

Save the active workbook in an application-level add-in

Call the SaveCopyAs method to save a copy of the active workbook in C#:

this.Application.Activeworkbook.SaveCopyAs(@”C\Book1.xls”);

Note: during run-time of saving or copying the workbook, if there is error in code, any of the methods will be cancelled interactively. For example, if the procedure calls the SaveAs method but not disable prompts from Excel and user clicks Cancel when promoted, Excel raises a run-time error.