+ Reply to Thread
Results 1 to 4 of 4

Inserting links to files by drag and drop

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    Munich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Inserting links to files by drag and drop

    Good morning everybody,

    I have an excel sheet with a lot of rows and one column should contain links to pdf files. Wouldn't be to hard if those pdf files were named systematically but they all have different names and they are stored in different locations. Of course i could use the hyperlink function and link to every single pdf file step by step, but I think that's much to complicated.

    Isn't there an easier way to achieve this? In Microsoft Word for example you can insert links to files by right clicking the file and drag&drop it into the word document. Then you have the possibility to choose "insert link" (or something like that).

    Isn't there a similar function in MS Excel? I use MS Excel 2010. I tried and i googled for hours, but I couldn't manage it...

    Any ideas how to solve my problem with a macro?

    Thanks for your help

    Chris
    Last edited by Buntspecht; 11-06-2012 at 10:43 AM.

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Inserting links to files by drag and drop

    If possible you could maby have excel search folder for the file and open it on find?

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    Munich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Inserting links to files by drag and drop

    Thank you for your quick answer, but then i would have to enter the name in some kind of searching field, right? That doesn't solve my problem...

  4. #4
    Registered User
    Join Date
    10-23-2012
    Location
    Munich
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Inserting links to files by drag and drop

    Hi again,

    I just wanted to tell you that I found a suitable solution for my problem. I've been searching for hours and now I will post my solution here so that perhaps other people find the solution that i couldn't find in the internet.

    First of all I have to say that I didn't find a solution that solved my problem, exactly in the way I described it, but it works for me... What my solution is able to do:

    When you click in a cell in column A, a popup window opens (file browser). This file browser has already a certain directory and it accepts by default only PDF files. (You can change all that of course). Now I can drag my PDF file in this window and drop it in this directory. The file will be copied in this directory automatically. By pressing enter a link to my file appears. So if it's okay for you that your file will be copied into an other directory and your hyperlink leads you there, then my solution will do it for you. If not, there is no other way to generate the hyperlinks manually file by file or install an AddOn (found something on the internet, but didn't try it).

    Now my solution:

    Right click the worksheet tab and click "show sourcecode". You will find a Sub called "Worksheet_SelectionChange".
    Replace it by this one:

    Please Login or Register  to view this content.
    This macro implies that the macro "LinkToPdf" is called, when you click a cell in column A. (or rather: A1 to A1000)



    Now we have to define our LinkToPdf Macro:

    Please Login or Register  to view this content.

    Where IsDiskFolder is a function to check if a folder already exists:

    Please Login or Register  to view this content.

    And tadaaaa: It works!

    Looking forward to your answers!
    Last edited by Buntspecht; 11-06-2012 at 10:42 AM.

+ 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