Excel 2003 Finding External Workbook links using VBA

D

Danny

All,

I have the following code that will find specific text in workbooks.

Sub findfiles()
With Application.FileSearch


.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.TextOrProperty = "Budget" 'Here is where I
replace "budget" with "=" or "[" (see note below)
.LookIn = xlFormulas
.MatchTextExactly = False
.FileType = msoFileTypeExcelWorkbooks
.Filename = "*.xls"
.Execute
If .Execute(msoSortByFileName) > 0 Then
If .Execute(msoSortOrderDescending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If

For i = 1 To .FoundFiles.Count
'MsgBox "Files found: " & .FoundFiles.Count& " file(s)
found."
MsgBox "There were " & .FoundFiles.Count & " file(s) found."

Next i



End If
End With
End Sub

This code works fine for finding specific text in excel workbooks.
However when I try to modify the code to find external links (IE "["
or formulas "=") it doesn't find these characters.

Any ideas on how to find workbooks that use External links?

Any help on this would be appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top