+ Reply to Thread
Results 1 to 4 of 4

how to specify user profile desktop path in excel vba

  1. #1
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Post how to specify user profile desktop path in excel vba

    hi,

    I have the below code which is working good on my computer.

    Now if i have to share with the file with some other user who have a different name it is not working because of userprofile.

    so, how to modify the below macro so that it should work on different user profile also.

    Please Login or Register  to view this content.
    the above code is not working if i am replacing c:\users\kishore with %userprofile%

    please help;
    Last edited by kishoremcp; 07-23-2013 at 03:44 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: how to specify user profile desktop path in excel vba

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-21-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: how to specify user profile desktop path in excel vba

    I have used the following code in a couple of my projects to identify the path for a user's desktop folder (can't remember where I found it, but I certainly can't claim it as my own):
    Please Login or Register  to view this content.
    You can then modify your code as follows:
    Please Login or Register  to view this content.
    Kyle123's post crossed with mine - apologies. Looks like this is the same approach.

  4. #4
    Forum Contributor
    Join Date
    01-17-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    402

    Re: how to specify user profile desktop path in excel vba

    Thanks Andrew1011, It worked perfectly..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run MS query in excel from any user desktop path
    By ewalters4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 01:29 PM
  2. Load data from excel using another user profile SQL
    By Dynic-IT in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2011, 09:50 AM
  3. Replies: 0
    Last Post: 10-01-2010, 04:22 PM
  4. How to path to user's desktop
    By 1scant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2006, 10:52 AM
  5. set default zoom for a user profile
    By blaqb0x in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 06:06 PM

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