+ Reply to Thread
Results 1 to 7 of 7

Display a documents properties from its hyperlink

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    Birmingham, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Display a documents properties from its hyperlink

    Hi All,
    Just joined and I've got a question. I'm putting together an Excel sheet which contains links to other files. I was wondering if I can display the properties of those files in an adjacent cell? Basically I want to show the date the document being pointed to in a hyperlink was last changed. The documents are contained on a local drive.

    Anyone out there know how to do this?

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Display a documents properties from its hyperlink

    I'd expect you would need to write a custom function in the vbaeditor. You could use this:
    Please Login or Register  to view this content.
    To use it:
    -Right click on the worksheet and select "view code"
    -click insert module
    -copy the code above into that module
    -on the worksheet type (for example), "=hyperlinkdate(A1)" to get the date of the hyperlink in A1
    -note, it will return the date as a dateserial number so you may need to format the cell as a date.

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    Birmingham, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Display a documents properties from its hyperlink

    Thanks,
    Put a hyperlink into A1 to a file on the c drive. Right clicking the worksheet didn't bring up the "view code" option so pressed the visual basic button. Right clicked on worksheet 1 and inserted module which appeared under VBAproject. Pasted the code into the Module 1 code window, formatted B1 as date and entered the "=hyperlinkdate(A1)". B1 now just says #NAME?. I take it I've cocked something up.

    Sorry if I'm being an idiot.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Display a documents properties from its hyperlink

    Seems like what you have done should work to me, check:
    -the code is in the module 1 window, not the sheet 1 window
    -that the module created is in the workbook that you are using the code in (just close any other workbooks?)
    -that you typed the formula after creating the function, it might not update automatically.

  5. #5
    Registered User
    Join Date
    05-29-2013
    Location
    Birmingham, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Display a documents properties from its hyperlink

    Sorry,
    It does work. I just needed to click B1 then click on the formula bar then the date comes up. Don't suppose you know how to make it auto update (he asked feeling somewhat cheeky)?

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Display a documents properties from its hyperlink

    Not really, you could try adding application.volatile at the start of the macro but not sure that changing the hyperlink would trigger that. Once you change one cell it should update all of them though.

  7. #7
    Registered User
    Join Date
    05-29-2013
    Location
    Birmingham, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Display a documents properties from its hyperlink

    Yes,
    That worked to. The date updates when I open the project after I've messed around with the hyperlinked files and saved them. Thanks a lot. Now if I only understood what you'd done...

    Many Thanks,
    Chris

+ 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