Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default ".MatchTextExactly = true" not always the case, please help.

I've written an Excel macro that searches through a list of files using
Application .FileSearch in a specified location created by another
application, and then does some other stuff with those files.

The macro looks for a standard filename to know which files are which, and I
built in a check to stop the routine if it comes across multiple files with
the same name, in case the other application was run multiple times resulting
in multiple copies of the files. The problem is that the output files from
the other application have some similarity, for example:
"1A.eplmdf"
"LA1A.eplmdf"
"S01A.eplmdf"

I set the .MatchTextExactly field equal to "True" which I thought would make
FileSearch actually match the text exactly, but instead if it's seeing all of
the files listed above with "1A.eplmdf" in their name.

Is there some way I can have it look for just "1A.eplmdf" and not see all of
the other files that have "1A.eplmdf" in their name?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default ".MatchTextExactly = true" not always the case, please help.

Are you using TextorProperty instead of Filename? MatchTextExactly is
behaving the way it is supposed to.
__________________________________________________ ____________________



"tenlbham" wrote in message
...
I've written an Excel macro that searches through a list of files using
Application .FileSearch in a specified location created by another
application, and then does some other stuff with those files.

The macro looks for a standard filename to know which files are which, and
I
built in a check to stop the routine if it comes across multiple files
with
the same name, in case the other application was run multiple times
resulting
in multiple copies of the files. The problem is that the output files
from
the other application have some similarity, for example:
"1A.eplmdf"
"LA1A.eplmdf"
"S01A.eplmdf"

I set the .MatchTextExactly field equal to "True" which I thought would
make
FileSearch actually match the text exactly, but instead if it's seeing all
of
the files listed above with "1A.eplmdf" in their name.

Is there some way I can have it look for just "1A.eplmdf" and not see all
of
the other files that have "1A.eplmdf" in their name?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ".MatchTextExactly = true" not always the case, please help.

matchtextexactly is a setting for when you are looking for files containing a
specific string. It has nothing to do with the filenames.

just get a list of probable files and loop through them picking out the
exact matches.

--
Regards,
Tom Ogilvy


"tenlbham" wrote:

I've written an Excel macro that searches through a list of files using
Application .FileSearch in a specified location created by another
application, and then does some other stuff with those files.

The macro looks for a standard filename to know which files are which, and I
built in a check to stop the routine if it comes across multiple files with
the same name, in case the other application was run multiple times resulting
in multiple copies of the files. The problem is that the output files from
the other application have some similarity, for example:
"1A.eplmdf"
"LA1A.eplmdf"
"S01A.eplmdf"

I set the .MatchTextExactly field equal to "True" which I thought would make
FileSearch actually match the text exactly, but instead if it's seeing all of
the files listed above with "1A.eplmdf" in their name.

Is there some way I can have it look for just "1A.eplmdf" and not see all of
the other files that have "1A.eplmdf" in their name?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default ".MatchTextExactly = true" not always the case, please help.

Ok, so if MatchTextExactly is searching for a string, is there another
parameter I can use to have FileSearch look for nothing else outside that
string? Or modify the search to look for nothing outside the string?

I'd like to keep from adding more code to search for results within the
search results.

Thanks.

"Tom Ogilvy" wrote:

matchtextexactly is a setting for when you are looking for files containing a
specific string. It has nothing to do with the filenames.

just get a list of probable files and loop through them picking out the
exact matches.

--
Regards,
Tom Ogilvy


"tenlbham" wrote:

I've written an Excel macro that searches through a list of files using
Application .FileSearch in a specified location created by another
application, and then does some other stuff with those files.

The macro looks for a standard filename to know which files are which, and I
built in a check to stop the routine if it comes across multiple files with
the same name, in case the other application was run multiple times resulting
in multiple copies of the files. The problem is that the output files from
the other application have some similarity, for example:
"1A.eplmdf"
"LA1A.eplmdf"
"S01A.eplmdf"

I set the .MatchTextExactly field equal to "True" which I thought would make
FileSearch actually match the text exactly, but instead if it's seeing all of
the files listed above with "1A.eplmdf" in their name.

Is there some way I can have it look for just "1A.eplmdf" and not see all of
the other files that have "1A.eplmdf" in their name?

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default ".MatchTextExactly = true" not always the case, please help.

Not sure exactly what you are after (I'd drop the .FileSearch), but
something like this ?

Private Sub CommandButton1_Click()
Dim FileName As String

Const PATH As String = "C:\"
Const FILTER As String = "??"
Const EXT As String = ".txt"

FileName = Dir(PATH & FILTER & EXT)

Do While FileName < ""
Debug.Print FileName
FileName = Dir()
Loop

End Sub

For 2 characters only in the filename, use
Const FILTER As String = "??"

For anything that ends in 1A in the filename, use
Const FILTER As String = "*1A"
...etc

If you need complex filtering, then get the filename and apply some LIKE
expression or resort to Regular Expressions.

NickHK

"tenlbham" wrote in message
...
I've written an Excel macro that searches through a list of files using
Application .FileSearch in a specified location created by another
application, and then does some other stuff with those files.

The macro looks for a standard filename to know which files are which, and

I
built in a check to stop the routine if it comes across multiple files

with
the same name, in case the other application was run multiple times

resulting
in multiple copies of the files. The problem is that the output files

from
the other application have some similarity, for example:
"1A.eplmdf"
"LA1A.eplmdf"
"S01A.eplmdf"

I set the .MatchTextExactly field equal to "True" which I thought would

make
FileSearch actually match the text exactly, but instead if it's seeing all

of
the files listed above with "1A.eplmdf" in their name.

Is there some way I can have it look for just "1A.eplmdf" and not see all

of
the other files that have "1A.eplmdf" in their name?

Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Typing "true" excel 2007 change it to "TRUE" Mr. T Excel Discussion (Misc queries) 2 April 11th 07 01:24 PM
how do I count only lower case "x" and exclude upper case "X" jbeletz Excel Worksheet Functions 3 October 14th 06 10:50 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
IF(VLOOKUP("MYDATA", MYNAME, 4) = 0, "TRUE", "FALSE") Souris Excel Programming 2 August 17th 05 05:33 AM


All times are GMT +1. The time now is 09:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"