Edit

Share via


_Application.Save(Object) Method

Definition

Saves changes to the specified workbook.

public void Save (object Filename);
Public Sub Save (Optional Filename As Object)

Parameters

Filename
Object

Examples

This example saves the active workbook.

<span class="label">ActiveWorkbook.</span>
<i>Save</i>

This example saves all open workbooks and then closes Microsoft Excel.

<span class="label">For Each w In Application.Workbooks     w.</span>
<i>Save</i>
<span class="label">Next w Application.Quit</span>

This example saves the active workbook.

<span class="label">ActiveWorkbook.</span>
<i>Save</i>

This example saves all open workbooks and then closes Microsoft Excel.

<span class="label">For Each w In Application.Workbooks     w.</span>
<i>Save</i>
<span class="label">Next w Application.Quit</span>

This example saves the active workbook.

<span class="label">ActiveWorkbook.</span>
<i>Save</i>

This example saves all open workbooks and then closes Microsoft Excel.

<span class="label">For Each w In Application.Workbooks     w.</span>
<i>Save</i>
<span class="label">Next w Application.Quit</span>

Remarks

To open a workbook file, use the Microsoft.Office.Interop.Excel.Workbooks.Open(System.String method.

To mark a workbook as saved without writing it to a disk, set its SaveData property to True.

The first time you save a workbook, use the Microsoft.Office.Interop.Excel._Workbook.SaveAs(System.Object method to specify a name for the file.

Applies to