+ Reply to Thread
Results 1 to 3 of 3

Save to desktop

  1. #1
    Registered User
    Join Date
    06-10-2009
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    36

    Save to desktop

    Hello All,

    I have a worksheet that I have been using for some time and its been working really well. One tweak I would like to make is to allow my code to save to any users desktop.
    Here is the code for my save button where I save the file and add the date to it. I would like to LEARN how to do this more than just have someone spit out the code...(or explain how it works?)

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    re: Save to desktop

    Hello zerodegreec,

    You can return the desktop path for the logged on user easily using the Windows Script Host. This is one of several Scripting languages used by Windows that are accessible from VBA. Copy this macro into a separate VBA module.
    Please Login or Register  to view this content.
    I have incorporated the macro into your code...
    Please Login or Register  to view this content.
    Here is a complete list of the special folders that are available:

    AllUsersDesktop

    AllUsersStartMenu

    AllUsersPrograms

    AllUsersStartup

    Desktop

    Favorites

    Fonts

    MyDocuments

    NetHood

    PrintHood

    Programs

    Recent

    SendTo

    StartMenu

    Startup

    Templates
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    re: Save to desktop

    Hello zerodegreec,

    Please take more care with your Thread Titles. The Forum Rules ask you not to use unnecessary words like VBA in your question titles
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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