+ Reply to Thread
Results 1 to 4 of 4

Referencing users desktop??

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Referencing users desktop??

    I have a file which i have created, it gets data from an excel file which is on a users desktop.
    The problem i am having is when i have created the macro it references a below
    .SourceDataFile = _
    "C:\Documents and Settings\uawesudz\Desktop\DATAfile.xls"

    when a different user to uawesudz trys to run the script it doesnt work. how do i make it look on the current users desktop. ie anyone can run it as long as the DATAfile.xls is on there desktop?

    Thanks in advance

    Steve

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Referencing users desktop??

    Hi,

    You can use this

    Please Login or Register  to view this content.
    Please take time to read the forum rules

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

    Re: Referencing users desktop??

    I'd prefer:
    Please Login or Register  to view this content.
    Or even better:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-09-2012
    Location
    UK
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    35

    Re: Referencing users desktop??

    so if i have the following piece of code where would i use this in it?

    Please Login or Register  to view this content.

+ 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