Name

workbook.SaveAs([Filename], [FileFormat], [Password], [WriteResPassword], [ReadOnlyRecommended], [CreateBackup], [AccessMode], [ConflictResolution], [AddToMru], [TextCodepage], [TextVisualLayout], [Local])

Synopsis

Saves the workbook and sets the workbook’s file properties.

Argument

Settings

Filename

The name of the file to save. Default is current filename.

FileFormat

One of the following xlFileFormat settings: xlCS, xlCSVMSDOS, xlCurrentPlatformText, xlDBF3, xlDIF, xlExcel2FarEast, xlExcel4, xlAddIn, xlCSVMac, xlCSVWindows, xlDBF2, xlDBF4, xlExcel2, xlExcel3, xlExcel4Workbook, xlExcel5, xlExcel7, xlExcel9795, xlHtml, xlIntlAddIn, xlIntlMacro, xlSYLK, xlTemplate, xlTextMac, xlTextMSDOS, xlTextPrinter, xlTextWindows, xlUnicodeText, xlWebArchive, xlWJ2WD1, xlWJ3, xlWJ3FJ3, xlWK1, xlWK1ALL, xlWK1FMT, xlWK3, xlWK3FM3, xlWK4, xlWKS, xlWorkbookNormal, xlWorks2FarEast, xlWQ1, xlXMLSpreadsheet.

Password

A password the user must enter to open the file.

WriteResPassword

A password the user must enter to open the file for read/write access.

ReadOnlyRecommended

True causes Excel to display a dialog box recommending the file be opened for read-only access when the user opens the file; False does not display the dialog box. Default is False.

CreateBackup

True creates a backup version of the file when the file is saved; False does not create a backup. Default is False.

AccessMode

One of the following xlSaveAccessMode settings: xlExclusive, xlNoChange (default), ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.