The path of a file found in a subdirectory using Filesearch...
Posted by Ben O. on October 05, 2000 8:15 AM
I'm using Application.Filesearch and I'd like to be able to search the subfolders of the search path that I specify. When I use .SearchSubFolders = True, problems arise when the file is found in a subfolder, because I need to link the file later. This is what I use to change the link:
.LookIn = Searchpath
.SearchSubFolders = True
.Filename = "Target.xls"
.MatchTextExactly = True
.FileType = xlExcelLinks
ActiveWorkbook.Changelink Name:="OldFilename.xls", NewName:=Searchpath & .Filename
The problem is that if the file was found in a subfolder of Searchpath, using Searchpath & .Filename as the name of the new link won't be accurate. I need to know the path that .Filename was found in. Is this possible?