SaveAs Method
This documentation is archived and is not being maintained.

_Workbook.SaveAs Method 

Saves changes to the workbook in a different file.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)

'Usage
Dim Filename As Object
Dim FileFormat As Object
Dim Password As Object
Dim WriteResPassword As Object
Dim ReadOnlyRecommended As Object
Dim CreateBackup As Object
Dim AccessMode As XlSaveAsAccessMode
Dim ConflictResolution As Object
Dim AddToMru As Object
Dim TextCodepage As Object
Dim TextVisualLayout As Object
Dim Local As Object
Dim _Workbook1 As _Workbook
_Workbook1.SaveAs(Filename, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, AddToMru, TextCodepage, TextVisualLayout, Local)

void SaveAs(
	[In, Optional] object Filename, 
	[In, Optional] object FileFormat, 
	[In, Optional] object Password, 
	[In, Optional] object WriteResPassword, 
	[In, Optional] object ReadOnlyRecommended, 
	[In, Optional] object CreateBackup, 
	[In, Optional] XlSaveAsAccessMode AccessMode, 
	[In, Optional] object ConflictResolution, 
	[In, Optional] object AddToMru, 
	[In, Optional] object TextCodepage, 
	[In, Optional] object TextVisualLayout, 
	[In, Optional] object Local
);
public void SaveAs(
	/*in*/System.Object Filename, 
	/*in*/System.Object FileFormat, 
	/*in*/System.Object Password, 
	/*in*/System.Object WriteResPassword, 
	/*in*/System.Object ReadOnlyRecommended, 
	/*in*/System.Object CreateBackup, 
	/*in*/XlSaveAsAccessMode AccessMode, 
	/*in*/System.Object ConflictResolution, 
	/*in*/System.Object AddToMru, 
	/*in*/System.Object TextCodepage, 
	/*in*/System.Object TextVisualLayout, 
	/*in*/System.Object Local
);
function SaveAs(
	 Filename : Object, 
	 FileFormat : Object, 
	 Password : Object, 
	 WriteResPassword : Object, 
	 ReadOnlyRecommended : Object, 
	 CreateBackup : Object, 
	 AccessMode : XlSaveAsAccessMode, 
	 ConflictResolution : Object, 
	 AddToMru : Object, 
	 TextCodepage : Object, 
	 TextVisualLayout : Object, 
	 Local : Object
);

Parameters

Filename

Optional Object. A string that indicates the name of the file to be saved. You can include a full path; if you don't, Microsoft Excel saves the file in the current folder.

FileFormat

Optional Object. The file format to use when you save the file. For a list of valid choices, see the FileFormat property. For an existing file, the default format is the last file format specified; for a new file, the default is the format of the version of Excel being used.

Password

Optional Object. A case-sensitive string (no more than 15 characters) that indicates the protection password to be given to the file.

WriteResPassword

Optional Object. A string that indicates the write-reservation password for this file. If a file is saved with the password and the password isn't supplied when the file is opened, the file is opened as read-only.

ReadOnlyRecommended

Optional Object. True to display a message when the file is opened recommending that the file be opened as read-only.

CreateBackup

Optional Object. True to create a backup file.

AccessMode

Optional XlSaveAsAccessMode.

ConflictResolution

Optional XlSaveConflictResolution.

AddToMru

Optional Object. True to add this workbook to the list of recently used files. The default value is False.

TextCodepage

Optional Object. Not used in U.S. English Microsoft Excel.

TextVisualLayout

Optional Object. Not used in U.S. English Microsoft Excel.

Local

Optional Object. True saves files against the language of Microsoft Excel (including control panel settings). False (default) saves files against the language of Visual Basic for Applications (VBA) (which is typically U.S. English unless the VBA project where Workbooks.Open is run from is an old internationalized XL5/95 VBA project).

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Show:
© 2016 Microsoft