0

In excel, I have a list of 'n' hyperlinks that link to a PDF drawing database. If the PDF does not exist in the database, the link to the database still works but the database returns an error message "not found".

When the PDF does exists, then it opens the PDF normally.

eg: Part number ABC1234 has a hyperlink http://database/database.exe?ABC1234

When there is no PDF existing the database returns the error: ABC1234 not found

I need some code that will check that the PDF actually exists within the database and highlight or remove the hyperlinks that do not open a PDF.

Thank you.

  • Maybe look at this for a starting point: https://stackoverflow.com/questions/58117601/vba-code-to-know-url-validity-that-will-check-whether-url-is-exist-or-not – Tim Williams Dec 03 '20 at 17:44
  • Thank you for a fast response, i tried this but got a compile error: user-defined type not defined – Cochise180 Dec 03 '20 at 20:41
  • See here for the reference to add, or use late-binding: https://stackoverflow.com/questions/3119207/sending-http-requests-with-vba-from-word – Tim Williams Dec 03 '20 at 20:56
  • Hello Tim, i just want to say i am a novice at VBA, so i tried the script you sent and it returns a 401 unauthorized access due to invalid credentials - however, the hyperlinks i am directing to are on my company server. maybe a different way of asking my question would be: is there a way to know if the hyperlink opens a PDF or not? – Cochise180 Dec 04 '20 at 15:49

0 Answers0