Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 9 of 9

Thread: vba save as dialog box...

  1. #1
    Join Date
    12th December 2003
    Posts
    714

    vba save as dialog box...

    vba save as dialog box...

    i would like to create with vba the file save as dialog box...and then let the user name and save the file wherever they want to...

    thank you...!

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    27th January 2003
    Location
    Auckland, New Zealand
    Posts
    396
    Look up the Function [GetSaveAsFilename]

    Whilst in the VBA Editor Press F1 and type in GetSaveAsFilename

    Post back if you need further help
    Kind Regards,
    Ivan F Moala From the City of Sails

    http://www.xcelfiles.com

  3. #3
    Join Date
    12th December 2003
    Posts
    714
    seems to work...(what was i doing...--thanks!

    and now, how can i manipulate the "Save In" and "File Name" and "Save as Type" comboboxes...?

    thank you!

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    12th December 2003
    Posts
    714
    ok...

    the dialog returns fiine, the fileSaveName always returns false and doesn't save the file...?

    thanks.

    Excel Video Tutorials / Excel Dashboards Reports


  5. #5
    Join Date
    15th April 2003
    Location
    USA
    Posts
    7,420
    The dialog will just return the filename (and path) that was selected. It's up to you to then save the file with another line of code. If False is returned, that means the Cancel key was used to terminate the dialog.

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    12th December 2003
    Posts
    714
    thank you...

    this works if is save the file, but not if i select the cancel button...(thank you!)
    ChDir "c:\Documents and Settings\Mark Schukas\My Documents\mjs\math\"
    fileSaveName = Application.GetSaveAsFilename( _
    fileFilter:="xls Files (*.xls), *.xls")
    ActiveWorkbook.SaveAs
    If fileSaveName <> False Then
    End If

    Excel Video Tutorials / Excel Dashboards Reports


  7. #7
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,717
    Hi

    Change this to

    VB:
    Sub YourMacro() 
        Dim fileSaveName As String 
         
         'OTHER CODE
         
        If fileSaveName <> "False" Then 
             'OTHER CODE
        End If 
         
    End Sub 
    
    

  8. #8
    Join Date
    12th December 2003
    Posts
    714
    thank you...!

    with a slight modification, this seems to work (a lot of fiddling just to get the file save as dialog box running...!)--thank you!

    Dim filename As String
    ChDir "c:\Documents and Settings\Mark Schukas\My Documents\mjs\math\"

    fileSaveName = Application.GetSaveAsFilename( _
    fileFilter:="xls Files (*.xls), *.xls")


    If fileSaveName <> "False" Then
    ActiveWorkbook.SaveAs
    End If

    Excel Video Tutorials / Excel Dashboards Reports


  9. #9
    Join Date
    15th April 2003
    Location
    USA
    Posts
    7,420
    I think you want

    If fileSaveName <> "False" Then
    ActiveWorkbook.SaveAs fileSaveName
    End If

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Replies: 2
    Last Post: May 10th, 2008, 08:11
  2. Save dialog
    By linkin_anytime in forum EXCEL HELP
    Replies: 9
    Last Post: October 12th, 2005, 12:07
  3. Save As Dialog Box
    By Ricochet in forum EXCEL HELP
    Replies: 1
    Last Post: May 10th, 2005, 17:01
  4. [Solved] VBA: Save Dialog Box
    By kiwichico in forum EXCEL HELP
    Replies: 2
    Last Post: November 21st, 2003, 05:23
  5. VBA: Disableing save the changes dialog box
    By JJacob in forum EXCEL HELP
    Replies: 3
    Last Post: November 16th, 2003, 23:17

Bookmarks

Posting Permissions

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