Consulting

Results 1 to 4 of 4

Thread: Solved: GetSaveAsFilename

  1. #1
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    291
    Location

    Solved: GetSaveAsFilename

    Is there a way using the above to suggest a filename to save.

    I know it is possible with Application.FileDialog(msoFileDialogSaveAs) but when I use this I cannot get the path to be a default path I want to set.

    I can set the default path with GetSaveAsFilename but dont know how to fill the Dailog with a suggested filename

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Dim mpFilename As String
    mpFilename = Application.GetSaveAsFilename( _
    InitialFileName:="Somename", _
    FileFilter:="Text Files (*.txt), *.txt")
    If mpFilename <> False Then
    MsgBox "Save as " & mpFilename
    End If
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    291
    Location
    Sorry got it the wrong way around. I can set the suggested filename for GetSaveAsFileName but not FileDialog.

    I need to either :-

    1) Set suggested filename for FileDialog

    OR

    2) Set defualt path for GetSaveAsFileName (I tired ChDir etc but it didnt work)

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Set ChDir and ChDrive to the full target path
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •