Report.SaveAs

Saves the report as the specified file path.

Syntax Parameters Return/assignment value
Function Report.SaveAs( _
    Name As String, _
    Optional Overwrite As Variant = 0) As Boolean
  • Name [in]

    The fully-qualified pathway to where the report shall be saved.

    Type: String

  • Overwrite [in, optional]

    Whether or not to overwrite the file if it already exists. This parameter defaults to False.

    Type: Variant

    Default value: 0

Boolean

SVB Example

Saving a backup of a report:

Option Base 1
Option Explicit
Sub Main
    Dim rpt As Report
    Set rpt = ActiveReport
    Dim DirPath As String
    DirPath = rpt.Path
    'save a backup copy of the report in the
    'same directory
    rpt.SaveAs(DirPath & rpt.Name & ".bak")
End Sub