+ Reply to Thread
Results 1 to 6 of 6

Automatic Save As and Close not working - please help!

  1. #1
    Registered User
    Join Date
    05-05-2014
    Location
    New Zealand
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    3

    Automatic Save As and Close not working - please help!

    Hi,

    I can't get a seemingly simple piece of code to work:

    I want to automatically 'save as' and close a document; however, the 'save as' dialogue box always comes up so that I have to click 'yes' before it will save the document. I would like this to be fully automatic so that when I run my macro I won't ever see the dialogue box (i.e. saves and closes automatically).

    I've tried all of the existing suggestions for this type of problem but to no avail!

    My code is given at the bottom of this post. The 'save' section is right at the end.

    Thanks in advance for your help!

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automatic Save As and Close not working - please help!

    Before SaveAs add this line

    Please Login or Register  to view this content.
    Add it again afterwards and reset it to True. HTH
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  3. #3
    Registered User
    Join Date
    05-05-2014
    Location
    New Zealand
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    3

    Re: Automatic Save As and Close not working - please help!

    Hi HTH,

    Thank you very much for your suggestion.

    However, it didn't close the dialogue box; I'm puzzled as to why!

    I entered your suggestion as follows:

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automatic Save As and Close not working - please help!

    Quote Originally Posted by IPD View Post
    However, it didn't close the dialogue box; I'm puzzled as to why!
    Because stringInput is using Application.GetSaveAsFilename? You shouldn't need to.

    Try changing your code to match the below

    Please Login or Register  to view this content.

    P.S. HTH is an abbreviation of Hope That Helps.

  5. #5
    Registered User
    Join Date
    05-05-2014
    Location
    New Zealand
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    3

    Re: Automatic Save As and Close not working - please help!

    Thank you very much mc84excel!!!

    It worked like a charm.

    I understand a little more about VBA now so thanks.

    Right,thanks for letting me know about HTH, as you can see I'm quite a rookie in forums!



    A+++ help rating

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automatic Save As and Close not working - please help!

    Quote Originally Posted by IPD View Post
    Thank you very much mc84excel!!!

    It worked like a charm.

    I understand a little more about VBA now so thanks.

    Right,thanks for letting me know about HTH, as you can see I'm quite a rookie in forums!



    A+++ help rating
    Glad to help.


    If your thread is solved, please use 'Thread Tools' (dropdowns at the top of your thread) to mark it SOLVED as a courtesy to other forum users.

    If my posts helped solve your thread, please consider taking a few seconds to click '* Add Reputation' on the post that helped. Thank you.

+ 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. Code for automatic close and save after lap of time
    By Raphski in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2012, 09:24 AM
  2. [SOLVED] Automatic save on close but no pop up
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-21-2012, 12:34 AM
  3. .Save, .Activate, .Close not working in Macro
    By jstephens in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2011, 05:34 PM
  4. Cascaded Open / Close / Save not working
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2009, 08:08 AM
  5. Help with automatic save and close after set time
    By redstang423 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2006, 02:25 AM

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