• Links (EXCEL XP)

    Author
    Topic
    #426464

    I have created a spreadsheet that has links (i.e., like a menu page) to other spreadsheets via the insert, hyperlink menu choices–I then link to an existing file. All of the Excel spreadsheets are on the same drive (c:) and in the same folder (production). Everything works great. But now, I have been requested to make this application (i.e., the spreadsheets) available via a USB flash drive so that associates can work on these spreadsheets while away from the office. I then copied the spreadsheet files to the USB flash drive—no problem yet.

    The problem is that all of the links are “hard” coded, C:JCCproductionfilename.xls. Naturally this directory only exists on my “C” drive on my work computer. Is there a way to make the links to the other spreadsheets dynamic, that is to use whatever letter the USB flash drive may be when the initial worksheet is opened? While the drive letter is dynamic, the “production” folder will always be on the USB drive and contain all of the EXCEL files. Has anyone created a “portable” excel application to be used via a USB drive?

    I would love to tell you that my end users are sophisticated enough to go to Windows explore and locate the various spreadsheets—but they are not. To make this application work via a USB drive, it has to work like it does at the office. THANKS.

    Viewing 0 reply threads
    Author
    Replies
    • #985665

      Hyperlinks may be relative or absolute.

      If you put the master in a folder and have all the references in that folder (or in the same relative space in a folder or the drive) they should work.

      If you hardcoded the file paths then it will always look for them in the hardcoded path.

      You can use a simple find/replace (like in post 307,979 ) to change the paths to relative (or even have the code run in the workbook open of the “menu book” to update all the links with the current path of the file on the flash drive.)

      Steve

      • #985669

        Steve, thanks. How could I discern the assigned drive letter of the usb via excel vba? I would need this information to fire up a macro at the launch of the “master or menu” workbook to revise the links. I’d prefer not to have to “ask” the end user for this information. Thanks again.

        • #985677

          It should be easily obtained by looking at “thisworkbook.path”. You could store it in a variable:

          dim sPath as String
          sPath = ThisWorkbook.Path

          This should be valid whether it is copied to a USB, or even another folder on their harddrive or on the network (though it may include more than just the drive letter…).

          Steve

          • #985693

            Steve,
            Thanks again…I will give this try tomorrow. Take care.

    Viewing 0 reply threads
    Reply To: Links (EXCEL XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: