Freigeben über


WorkbookBase.SaveCopyAs Method

Saves a copy of the workbook to a file but does not modify the open workbook in memory.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public Sub SaveCopyAs ( _
    filename As Object _
)
public void SaveCopyAs(
    Object filename
)

Parameters

  • filename
    Type: System.Object

    Specifies the file name for the copy.

Remarks

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Examples

The following code example uses the SaveCopyAs method to save a copy of the current workbook.

This example is for a document-level customization.

Private Sub WorkbookSaveCopyAs()
    Me.SaveCopyAs((Me.FullName & ".copy.xlsx"))
End Sub
private void WorkbookSaveCopyAs()
{
    this.SaveCopyAs(this.FullName + ".copy.xlsx");
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace