+ Reply to Thread
Results 1 to 7 of 7

save currently open file appended with today's date

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    save currently open file appended with today's date

    I'm trying to write a macro that will save my currently open file ("autoname.xlsm" and always kept void of data) appended with the current date (i.e. "autoname_01/01/11.xlsm") after data is entered and saved to the same folder. I've had zero luck.

    Any help would be appreciated.

    Thanks,
    roothog
    Last edited by roothog; 01-07-2011 at 05:22 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: save currently open file appended with today's date

    roothog,

    You should be getting an error that you can not use "/" or "\" in a filename.

    Try:

    autoname_01_01_11.xlsm

    or,

    autoname_01012011.xlsm
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Re: save currently open file appended with today's date

    That would be one mistake I made! I've read/tried several similar ideas from this forum but still can't make it work.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: save currently open file appended with today's date

    roothog,


    Can we see your macro code?


    At the beginning of your posted code, enter the following without the * character: [*code]


    'Your code goes here.


    At the end of your posted code, enter the following without the * character:
    [*/code]

  5. #5
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Re: save currently open file appended with today's date

    I have tried the following from a Jerry Beaucaire post a few months ago (changing path\filename only) and it should be exactly what I need. But it doesn't save any new file at all for me.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: save currently open file appended with today's date

    roothog,

    The code worked for me with a slightly different path, using Excel 2007.

    When you did a File SaveAs, the file should have automatically been saved with the original filename and the new extension.

    Did you check the directory/folder c:\2011\ to see if the file had been saved?

    Did you check the filename in Excel at the top of the computer screen?

    You can send JBeaucaire a Private Message requesting help.
    Last edited by stanleydgromjr; 01-05-2011 at 08:56 PM.

  7. #7
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Smile Re: save currently open file appended with today's date

    Yes on all of the above. BUT...it now works! I did not have the code in "This Workbook" but a module.

    Thanks for your help, Stan!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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