Workbook.SaveAs
Use this function to save the workbook to a file.
| Syntax | Parameters | Return value |
|---|---|---|
Function Workbook.SaveAs( _
Name As String, _
Optional Overwrite As Variant = 0) As Boolean
|
|
Boolean |
SVB Example
Backing up a workbook document
Option Base 1
Option Explicit
Sub Main
Dim wb As Workbook
Set wb = ActiveWorkbook
Dim FilePath As String
FilePath = wb.FullName
'save a backup copy of the workbook in the
'same directory
wb.SaveAs(FilePath & ".bak")
End Sub