+ Reply to Thread
Results 1 to 8 of 8

GetSaveAsFilename almost works... need a little Help!

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    GetSaveAsFilename almost works... need a little Help!

    I have a .xltm template that is a form used by several users. After the user enters some information (Co, MASitem, MASdesc) the form is ready to be saved. There is a button that launches the code below. Right now it successfully opens the saveas dialog and fills in the file name and .xlsm extension correctly. When save is clicked the window closes, but nothing is saved! Obviously I'm missing something... help please!

    - Ian

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,515

    Re: GetSaveAsFilename almost works... need a little Help!

    It does what it says on the tin. It gets the Save As Filename ... and stores it in a variable, var. you then need to use that to save the file.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: GetSaveAsFilename almost works... need a little Help!

    Perhaps you add the following:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: GetSaveAsFilename almost works... need a little Help!

    Trevor,

    I'm not sure what to do with var at this point. I've only got as far as I have using examples on excelforum.com and other helpful sites. I assumed that clicking okay on the SaveAs window was the end of the road.

    I re-read the Excel Help and understand what you are saying a little better. Basically when okay is clicked it passed var back, so I need to write some code to actually save the file, right?

    - Ian

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: GetSaveAsFilename almost works... need a little Help!

    Hi nexidnai,

    try use the SaveAs-function with Var (that stores the SaveAs name as Trevor outlined) at the end of your procedure, as I tried to show in my previous post.

  6. #6
    Registered User
    Join Date
    10-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: GetSaveAsFilename almost works... need a little Help!

    I added the code below and it seems to work. Don't know if there should be anything to handle errors.

    - Ian

    Please Login or Register  to view this content.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,515

    Re: GetSaveAsFilename almost works... need a little Help!

    You're welcome. Thanks for the rep.

    There shouldn't really be any errors to handle, I don't think, because you've used the dialogue box to navigate to a folder, etc.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: GetSaveAsFilename almost works... need a little Help!

    Great! Sorry if I may have only confused you noxidnai, meant to set wb = Thisworkbook.

    All best

+ 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. GetSaveAsFilename
    By DonHuff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2009, 04:31 AM
  2. Application.GetSaveAsFilename
    By leighmills33 in forum Excel General
    Replies: 1
    Last Post: 03-21-2008, 12:14 PM
  3. GetSaveAsFilename
    By Steel Monkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2007, 11:01 PM
  4. [SOLVED] HOW DO I USE THE GETSAVEASFILENAME METHOD?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2006, 01:55 PM
  5. GetSaveasFileName
    By Libby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2005, 03:05 PM

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