brigham
asked on
Create hyperlink to searchfile result
I have an excel spreadsheet with over 7000 names of image files (TIF and JPG) on our server contributed by scientists around the world. I would like to write a VBA macro to hyperlink the file name on the Excel worksheet "index" to the files. All of the files are in the same directory, but scattered into many subfolders. I have written a "searchfile" macro to that takes the content of the Excel cell and finds the appropriate file. The problem is that there is a variable file path and the files have different extensions (mostly TIF and JPG). Any suggestions would be greatly appreciated. thanks, Brigham
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The "FoundFiles" object gave me the path and file extension.
Hi,
Do you need any further assistance?
BFN,
fp.
Do you need any further assistance?
BFN,
fp.
Thank you once again.
fanpages,
While I appreciate the thanks, please be aware that whenever there is a comment posted after the recommendation, it takes the Moderator a few extra keystrokes to finalize the Q. Again, I appreciate the gesture, but if you don't have an objection to the recommendation, it is slightly better for the Cleanup Crew if you don't post. I'm fine with assuming that you have thanked me in your heart :-)
-- Dan
While I appreciate the thanks, please be aware that whenever there is a comment posted after the recommendation, it takes the Moderator a few extra keystrokes to finalize the Q. Again, I appreciate the gesture, but if you don't have an objection to the recommendation, it is slightly better for the Cleanup Crew if you don't post. I'm fine with assuming that you have thanked me in your heart :-)
-- Dan
OK, noted Dan, thank you... and apologies for this (final) comment :)
ASKER
Set fs = Application.FileSearch
With fs
.LookIn = "D:\Images"
.SearchSubFolders = True
.FileName = MyFile
End With
FileSearch finds the file, but does it provide an address for the hyperlink? Thanks, b