(Msg. 1) Posted: Mon Dec 22, 2008 8:45 pm
Post subject: Valid Hyperlinks being reported as Invalid Archived from groups: microsoft>public>excel>links (more info?)
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 procedure:
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?
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum