A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Valid Hyperlinks being reported as Invalid



 
 
Thread Tools Display Modes
  #1  
Old December 23rd, 2008, 04:45 AM posted to microsoft.public.excel.links
Steve
external usenet poster
 
Posts: 2,662
Default Valid Hyperlinks being reported as Invalid

Because of problems with hyperlinks randomly changing without any
intervention a VBA procedure was written to perform various validation checks
on the hyperlinks. One of the checks is to see if the link actually exist
and if not report an error. Following is an excerpt of the VBA procedu

For Each h in Worksheets(curwksname).Hyperlinks
If (Dir(h.Address) = “”) then
Cells(errndx,1) = “Invalid link to file: “& h.Address
errndx = errndx + 1
End If
Next

The Dir function return “” for every hyperlink thus, they are all reported
as invalid. However, when selecting the hyperlink within the worksheet the
link works fine. So, why does the Dir function not locate the file?

Following is the value contained in h.Address:

...\..\..\dirnam1\dirnam2\dirnam3\dirnam4\dirnam5\ filename

where dirnam is the levels of directories..

Following is the value displayed when I place the cursor over the hyperlink
in the Excel spreadsheet:

file:///\\NetworkId\Groups\..\..\..\dirnam1\dirnam2\dirnam 3\dirnam4\dirnam5\filename

Thank you for your time.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.