+ Reply to Thread
Results 1 to 4 of 4

File Save As Dialog with VBA

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    69

    File Save As Dialog with VBA

    Hi,

    I am currently using this code I found here (http://software-solutions-online.com...aveasfilename/) to open a saveas dialog with VBA (trying to get the file to save as macro-free workbook with a click of a button).

    Sub Example2()
    Dim varResult As Variant
    'displays the save file dialog
    varResult = Application.GetSaveAsFilename( _
    FileFilter:="Excel Files (*.xlsx), *.xlsx")
    'checks to make sure the user hasn't canceled the dialog
    If varResult <> False Then
    Cells(2, 1) = varResult
    End If
    End Sub


    Could someone help with changing the code so that the file would actually save?

    Thanks!

    Pho6

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,985

    Re: File Save As Dialog with VBA

    if you wish to simply automatically save a file as another name then

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: File Save As Dialog with VBA

    try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    07-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: File Save As Dialog with VBA

    Quote Originally Posted by Olly View Post
    try:
    Please Login or Register  to view this content.
    Thanks Olly! This worked perfectly. Exactly what I needed.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to Save A File Using Dialog Box?
    By mitchivous in forum Excel General
    Replies: 0
    Last Post: 07-14-2013, 10:24 PM
  2. [SOLVED] automatic name in 'save as dialog box' ok, but does not actually save the file?!
    By Pluym in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-02-2012, 10:05 AM
  3. save file dialog box
    By Directlinq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2009, 04:43 PM
  4. How to set file Filter in Save dialog box
    By sreenath205 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2006, 08:53 AM
  5. [SOLVED] How do you disable save file dialog?
    By someone in forum Excel General
    Replies: 3
    Last Post: 02-12-2005, 08:06 PM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1