Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Save workbook in My Documents using VBA

    Hi... I have an expense report worksheet used by all staff. I want to provide a button to save the worksheet in each user's 'My Documents' folder and use their windows login ID and current date as part of the file name.

    Can someone help?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    Something like this perhaps:

    ActiveWorkbook.SaveAs Environ$("UserProfile") & "\My Documents\" & _
    Environ$("UserName") & " - " & Format(Date, "yyyy-mmm-dd") & ".xls"

    Steve

  3. The Following User Says Thank You to sdckapr For This Useful Post:

    SueP (2012-02-22)

  4. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks Steve... much appreciated.

Posting Permissions

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