Testing for hyperlink error

  • Thread starter James W. Johnson
  • Start date
J

James W. Johnson

I have an artifact database with a bit over 4000 entries, and I'm usin
the hyperlink function to 'attach' a jpg photo to each artifact. Th
problem is that not all artifacts have a photo, and I wish to be able t
use a column to indicate which links are valid, and which yet need
photo.
How do I test for a lack of photo, using hyperlink? I do get a messag
informing me of the missing photo, but I hope not to have to go throug
the database one artifact at a time..
 
C

Claus Busch

Hi James,

Am Sun, 7 Jul 2013 06:56:11 +0100 schrieb James W. Johnson:
I have an artifact database with a bit over 4000 entries, and I'm using
the hyperlink function to 'attach' a jpg photo to each artifact. The
problem is that not all artifacts have a photo, and I wish to be able to
use a column to indicate which links are valid, and which yet need a
photo.
How do I test for a lack of photo, using hyperlink? I do get a message
informing me of the missing photo, but I hope not to have to go through
the database one artifact at a time...

your hyperlinks in column A.
Put following function in a standard module and call the function into
the sheet with:
=picExists(A1)

Function picExists(myCell As Range) As Boolean
Dim strFile As String

strFile = Replace(myCell.Hyperlinks(1).Address, "File///", "")
picExists = IIf(Dir(strFile) <> "", True, False)
End Function

Regards
Claus B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top