+ Reply to Thread
Results 1 to 5 of 5

Manage external data source locations in Excel when sharing the file across Dropbox

  1. #1
    Registered User
    Join Date
    07-02-2017
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    7

    Manage external data source locations in Excel when sharing the file across Dropbox

    When working in Excel, sometimes we have external data sources.

    In Windows, these files may be stored in a specific location such as C:\Users\Freelensia\Dropbox\data source.xls

    When sharing the main file and the data source file with another person through file-sharing services such as Dropbox, the location of the data source will be changed to:

    C:\Users\PeterSmith\Dropbox\data source.xls (from the view of the Peter Smith user)

    This will break the data connection in the main file when Peter opens it. He can reset the path to the one as seen from his computer, but that will break the connection for the Freelensia user when he/she opens it from his/her end.

    Is there a way to permanently fix these locations for multiple users? Such that Excel will correctly get the path when the right user opens it.

    I am looking for an inherent Excel property if such a thing exists. Else VBA macros (A table with the file paths for each user, and MsgBox that ask the user to choose the user profile). Else a Windows .bat file could work as well.

    Thank you for your help.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Manage external data source locations in Excel when sharing the file across Dropbox

    You talk about external data sources, main file, and data source file. Can you be more specific about which file references which other file and how? You have posted in the VBA subforum, so are these references in the VBA code? Or are they in formulas? Where are these two files stored relative to each other?

    I use one file that has formulas with external links to another file. Generally in Excel, formulas with external links are relative links. However, the implementation is confusing because Excel will show the full path name. For example, I have one file called Scratch that is located at this path:

    'C:\Users\Jeff\Dropbox\Management\Labor reports\Scratch.xlsx'

    This file contains a formula which contains a link to another file in the same folder. The formula looks like this:

    ='C:\Users\Jeff\Dropbox\Management\Labor reports\[Actuals Latest.xlsm]Rates'!$J$8

    However, contrary to appearances, this is a relative link. If I close the files and copy these same two files to another folder, now the formula looks like this:

    ='C:\Users\Jeff\Documents\scratch\[Actuals Latest.xlsm]Rates'!$J$8

    Excel has automatically updated the formula to refer to the same relative location.

    I take advantage of this to share files between two machines using Dropbox.

    Therefore, if all your users store the main file and data source file in the same folder, then the external references will work no matter what folder it is, no matter what machine is it. It doesn't even have to be the same folder, as long as the two folders are the same relative to each other. In your case they should both be under the Dropbox structure.

    If all of this is in VBA then the story is a little different. In VBA the user's main folder can be referenced as

    Please Login or Register  to view this content.
    In my case this returns string "C:\Users\Jeff". The standard location for the Dropbox folder is immediately under this so you could use

    Please Login or Register  to view this content.
    I use the default. However, Dropbox allows the user to select a custom location. This is a power-user option and not many people do it, but if they do, this becomes more difficult. Dropbox does not set a Windows environment variable for this, and I'm not sure how to find it. .
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Manage external data source locations in Excel when sharing the file across Dropbox

    please read the forum rules, especialy the ones about crossposting.

    https://www.mrexcel.com/forum/excel-...s-dropbox.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Manage external data source locations in Excel when sharing the file across Dropbox

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this (most other forums have the same rule).

  5. #5
    Registered User
    Join Date
    07-02-2017
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    7

    Re: Manage external data source locations in Excel when sharing the file across Dropbox

    Dear moderators, I just joined the forum. Sorry I did not know that cross-posting is not allowed.

    Dear 6StringJazzer, thanks, the relative reference helps. I did not know that.
    So if we have C:\Folder A\Folder 1\main file.xls
    And it refers to: C:\Folder A\Folder 2\reference file.xls
    Then if I share Folder A and its sub-folders with another user on Dropbox, and the person doesn't move the folders, then the reference should still work, right?

    About the environ variable in VBA, this is a good function. I will try to use. Thanks!

    -Freelensia

+ 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. Accessing data in an external link when you dont have the source file
    By JFNORDEN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-05-2017, 08:09 PM
  2. cell of thepivot table that use external file as data source
    By mrkhchan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2014, 11:17 PM
  3. Excel VBA Code to upload a file to Dropbox using the Dropbox API
    By gb# in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2014, 03:41 PM
  4. Replies: 2
    Last Post: 11-12-2009, 10:31 AM
  5. external data file locations
    By Lou Sanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2006, 12:25 PM
  6. [SOLVED] external data file locations
    By Lou Sanderson in forum Excel General
    Replies: 4
    Last Post: 04-26-2006, 12:20 PM
  7. [SOLVED] Import External Data Source File Location Changed
    By Louise in forum Excel General
    Replies: 3
    Last Post: 01-04-2006, 10:50 AM

Tags for this Thread

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