View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Danny[_2_] Danny[_2_] is offline
external usenet poster
 
Posts: 22
Default Excel 2003 Finding External Workbook links using VBA

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