_Application.GetSaveAsFilename Method

Displays the standard Save As dialog box and gets a file name from the user without actually saving any files.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function GetSaveAsFilename ( _
    InitialFilename As Object, _
    FileFilter As Object, _
    FilterIndex As Object, _
    Title As Object, _
    ButtonText As Object _
) As Object
'Usage
Dim instance As _Application
Dim InitialFilename As Object
Dim FileFilter As Object
Dim FilterIndex As Object
Dim Title As Object
Dim ButtonText As Object
Dim returnValue As Object

returnValue = instance.GetSaveAsFilename(InitialFilename, _
    FileFilter, FilterIndex, Title, ButtonText)
Object GetSaveAsFilename(
    Object InitialFilename,
    Object FileFilter,
    Object FilterIndex,
    Object Title,
    Object ButtonText
)

Parameters

  • InitialFilename
    Type: System.Object

    Optional Object. Specifies the suggested file name. If this argument is omitted, Microsoft Excel uses the active workbook's name.

  • FileFilter
    Type: System.Object

    Optional Object. A string specifying file filtering criteria.

    This string consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. Each separate pair is listed in the Files of type drop-down list box. For example, the following string specifies two file filters, text and addin: "Text Files (*.txt), *.txt, Add-In Files (*.xla), *.xla".

    To use multiple MS-DOS wildcard expressions for a single file filter type, separate the wildcard expressions with semicolons, for example, "Visual Basic Files (*.bas; *.txt),*.bas;*.txt".

    If omitted, this argument defaults to "All Files (*.*),*.*".

  • FilterIndex
    Type: System.Object

    Optional Object. Specifies the index number of the default file filtering criteria, from 1 to the number of filters specified in FileFilter. If this argument is omitted or greater than the number of filters present, the first file filter is used.

  • Title
    Type: System.Object

    Optional Object. Specifies the title of the dialog box. If this argument is omitted, the default title is used.

  • ButtonText
    Type: System.Object

    Optional Object. Macintosh only.

Return Value

Type: System.Object

Remarks

This method returns the selected file name or the name entered by the user. The returned name may include a path specification. Returns False if the user cancels the dialog box.

This method may change the current drive or folder.

See Also

Reference

_Application Interface

_Application Members

Microsoft.Office.Interop.Excel Namespace