Consulting

Results 1 to 3 of 3

Thread: Saving an activeworkbook as a time stamp

  1. #1

    Question Saving an activeworkbook as a time stamp

    I am having some compatibility issues with office 2003 and office 2007.

    I think there may be a problem in the operating system too like the difference between vista and xp just wanted to get it clear in my head.

    Does anyone have any good sites or references in how to format a file in all versions?

    What i was wanting was like say 'report_11_15_20_12_2008.csv'

    Where the first 11 is the hour it was generated, 15 is the minute it was generated, 20 was the day it was generated and the month and finally the year.

    Can someone help please?

    Thanks,
    Jeremy.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What exactly is the issue?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    I don't have 2007 but I use
    [vba]NewName = Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) & " " & Format(Now, "dd mmm yyyy hh_mm_ss")
    NewName = "C:\Archived Files\" & NewName & ".xls"
    ThisWorkbook.SaveCopyAs NewName[/vba] I would have expected 2007 to yield the same result; to get your time stamp in the same format use
    [vba]format(Now,"hh_mm_dd_mm_yyyy")[/vba] You're not making it very clear what the problem might be though...
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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