ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003 Finding External Workbook links using VBA (https://www.excelbanter.com/excel-programming/412350-excel-2003-finding-external-workbook-links-using-vba.html)

Danny[_2_]

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



All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com