jimrward
Well-known Member
- Joined
- Feb 24, 2003
- Messages
- 1,824
- Office Version
-
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
-
- Windows
this is a strange one, I am using XL2000 to search a series of folders containing WD2000 files for text within a document
On one folder only the macro will abort and shut down Excel when the search term is a single word, when it is a single letter, it will perform the search.
All other folders are fine, I have checked folder attributes and permissions, all seem to be similar across folders
The code is standard as found all over the net
With Application.FileSearch
.NewSearch
.LookIn = FolderToSearch
.SearchSubFolders = True
.FileName = "*.doc"
.MatchTextExactly = False
.TextOrProperty = TextToFind
.FileType = msoFileTypeWordDocuments
' .FileTypes.Add msoFileTypeExcelWorkbooks ' so we can AND in other file types
.Execute
It dies on the .execute when the TextToFind is a string of characters, all other variables are correctly loaded
The error is not trappable, and does not appear in system logs or Dr Watson
Anyone else seen this
On one folder only the macro will abort and shut down Excel when the search term is a single word, when it is a single letter, it will perform the search.
All other folders are fine, I have checked folder attributes and permissions, all seem to be similar across folders
The code is standard as found all over the net
With Application.FileSearch
.NewSearch
.LookIn = FolderToSearch
.SearchSubFolders = True
.FileName = "*.doc"
.MatchTextExactly = False
.TextOrProperty = TextToFind
.FileType = msoFileTypeWordDocuments
' .FileTypes.Add msoFileTypeExcelWorkbooks ' so we can AND in other file types
.Execute
It dies on the .execute when the TextToFind is a string of characters, all other variables are correctly loaded
The error is not trappable, and does not appear in system logs or Dr Watson
Anyone else seen this
Last edited: