ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hyperlink function verification (https://www.excelbanter.com/excel-programming/291638-hyperlink-function-verification.html)

Mike Dickey

hyperlink function verification
 
I have a spreadsheet that allows me to filter down to
specific groups of items in an inventory system. I used
the HYPERLINK function to create links to PDF drawings
(approx. 900) to confirm part selection. Creating
hyperlinks for each drawing would be much too time
consuming. The drawings are updated or changed once in a
while. Over time I have encountered broken links in the
spreadsheet. I need help verifying the existence of the
links. Does anyone know of a function, marco, or VBA code
that will verify the existence of the target file for each
hyperlink?

Tom Ogilvy

hyperlink function verification
 
Assuming the Address of the hyperlink contains the fully qualified path to
the file then

for each lnk in Activesheet.hyperlinks
sAddr = lnk.Address
if dir(sAddr) = "" then
' not found, do what
else
' verified, do what
end if
Next
--
Regards,
Tom Ogilvy

"Mike Dickey" wrote in message
...
I have a spreadsheet that allows me to filter down to
specific groups of items in an inventory system. I used
the HYPERLINK function to create links to PDF drawings
(approx. 900) to confirm part selection. Creating
hyperlinks for each drawing would be much too time
consuming. The drawings are updated or changed once in a
while. Over time I have encountered broken links in the
spreadsheet. I need help verifying the existence of the
links. Does anyone know of a function, marco, or VBA code
that will verify the existence of the target file for each
hyperlink?




Mike Dickey

hyperlink function verification
 
Thanks Tom,

I made a few changes to massage this into a function. It
does what I need.

Public Function CheckHyperlink(sAddr As String) As Boolean
If Dir(sAddr) = "" Then
CheckHyperlink = False
Else
CheckHyperlink = True
End If
End Function

I had to copy the link_location into another cell because
it was reading the entire cell contents as a string. Is
there some way to get just the link_location argument from
the HYPERLINK function without parsing in this case?

-----Original Message-----
Assuming the Address of the hyperlink contains the fully

qualified path to
the file then

for each lnk in Activesheet.hyperlinks
sAddr = lnk.Address
if dir(sAddr) = "" then
' not found, do what
else
' verified, do what
end if
Next
--
Regards,
Tom Ogilvy

"Mike Dickey" wrote

in message
...
I have a spreadsheet that allows me to filter down to
specific groups of items in an inventory system. I used
the HYPERLINK function to create links to PDF drawings
(approx. 900) to confirm part selection. Creating
hyperlinks for each drawing would be much too time
consuming. The drawings are updated or changed once in a
while. Over time I have encountered broken links in the
spreadsheet. I need help verifying the existence of the
links. Does anyone know of a function, marco, or VBA code
that will verify the existence of the target file for each
hyperlink?



.



All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com