+ Reply to Thread
Results 1 to 7 of 7

External reference to xls file of same name on different users desktops regardless of user

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    External reference to xls file of same name on different users desktops regardless of user

    Hello : )

    My name is Dave Schneider

    I'm gonna keep this short.

    20 users that export data in *.xls format to their desktops and each name the exported file simply exported.xls.

    I have code that is able to link to my *.xls file on my desktop using a command button to fetch the values. (example below of just one line) works like a champ!

    Worksheets("Daily Report").Range("B19").Value = "='C:\Users\dschneid\Desktop\[exported.xls]Sheet1'!R7C5"

    But since each user has a different username & path to desktop, my code does not work for all. What do I put in code that tells excel to fetch the values from exported.xls on desktop regardless of user?

    Would really appreciate help.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: External reference to xls file of same name on different users desktops regardless of

    Try:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: External reference to xls file of same name on different users desktops regardless of

    Quote Originally Posted by TMS View Post
    Try:
    Please Login or Register  to view this content.
    TMS,

    Thank you so much for your reply. Your code worked good on my computer. When I tried it on another computer with a different username, for every entry, it pops up a windows dialog box to point to the file it's referring to. So for 30 entries, you have to point to the file 30 times. If you hit cancel, it just puts REF in the cell that didn't get linked.
    Last edited by dshandyman; 02-06-2017 at 05:00 PM. Reason: typo

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: External reference to xls file of same name on different users desktops regardless of

    Can you upload sample workbooks?

  5. #5
    Registered User
    Join Date
    12-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: External reference to xls file of same name on different users desktops regardless of

    Quote Originally Posted by TMS View Post
    Can you upload sample workbooks?
    Absolutely!
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: External reference to xls file of same name on different users desktops regardless of

    Ok, will have a look tomorrow.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: External reference to xls file of same name on different users desktops regardless of

    I don't know why it's not working for them, other than it may be opening in protected mode because the file has been emailed to them.

    It worked fine. Maybe make sure they save the attachment to their Desktop first and, to be on the safe side, open it and enable editing.

    You don't really need 30 lines of code to populate the table, assuming that it is just a block of data that you are transferring in order to chart it. You can just use this one line:

    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)

Similar Threads

  1. Reference External File
    By scruz9 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-21-2016, 03:14 PM
  2. [SOLVED] How to absolute reference external file path in formula
    By bob07904 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-30-2015, 04:42 AM
  3. [SOLVED] Get external data from a user selected .txt file
    By trisoldee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2014, 03:00 PM
  4. Named Range reference changes when I send file to some users
    By fb7894 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2013, 08:02 AM
  5. Macro that finds specific file name on different desktops
    By meg0011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2012, 06:19 PM
  6. external reference to file in the same folder
    By Ragnoff in forum Excel General
    Replies: 1
    Last Post: 07-14-2006, 07:20 PM
  7. Replies: 1
    Last Post: 02-10-2005, 07: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