Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Save File to current User's Desktop

  1. #1
    Board Regular
    Join Date
    Mar 2007
    Location
    Chesapeake Bay area, Maryland
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Save File to current User's Desktop

    I have a VBMacro Excel file loaded on a Server that numerous people access. A Macro in this file creates a Copy of a specific Sheet within the Active Workbook and I want to Save it to the individual's Desktop.

    How do I find out what the current User's desktop folder path is each time the Marco is run by a different User?

    Example User's path: 'C:\Documents and Settings\jfarc\Desktop'

    Where 'jfarc' is the name of the current User which, will of course change with every different User that runs the Macro.

    Also, is there a way to pull out of Excel what is the current User's 'Options | General | Default File Location' entry? Which may differ from the above directory.

    I am familiar with and use the following coding for Opening/Saving files to the current directory of the opened workbook, but it only gives the path of the existing Excel workbook and not the current User's Directory Path:

    Dim wbThis As Workbook
    Set wbThis = ThisWorkbook
    ChDir wbThis.Path

  2. #2
    Banned
    Join Date
    Jul 2006
    Location
    Northeast Pennsylvania
    Posts
    3,656
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Save File to current User's Desktop

    jfarc,

    Try:

    Referencing Default File Location
    http://www.ozgrid.com/forum/showthread.php?t=39058

    Using VBA to find path of Desktop
    http://www.ozgrid.com/forum/showthread.php?t=24985

    Have a great day,
    Stan

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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