View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default best way to find

without having to "open" the file
should probably be
without having to "open" the file in Excel
<g

--
Regards,
Tom Ogilvy


"NickHK" wrote:

ADO= Microsoft Active Data Objects 2.x
Basically, it enables you to query (using SQL syntax) an Excel (and other
formats) file, without having to "open" the file.
But the files need to be in a database structure, otherwise the results are
unpredictable..

NickHK

"Sam Hodo" ...
Hi NickHK;

Please explain ADO..
thanks;


"NickHK" wrote:

Sam,
Try a Dir() with ADO so you do not have to open each file in Excel.
Otherwis the bogus results are not an Excel issue.

NickHK

"Sam Hodo" ...

Hi NickHK;

I wrote a VB script that shells
cmd.exe /c command string
the searchstring is
dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt

code I use is..
Dim RetVal
RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0)

when I execute this, it runs ok; but the resulting files created have
bogus
data.

I am looking for a better way to gather data that is not bogus.


Thank for your help
"NickHK" wrote:

I'm a bit confused, because although Excel can open open .txt files,
they
are not Excel files.
You can use ADO to query the files, if they have database structure.
But you write "All I need is the file names", so can you use Dir() ?

NickHK

"Sam Hodo" ...

Hi;

I need to look up 1800+ items in over 600+ files.
items are listed in .txt format
files are in excel format.

I would rather not have to open/close the excel files.. (takes too
long)

1) Is there a way to look these 1800 items up?
2) What is the best way to store the results.. in Excel, Txt or
other..

I know I can shell to the cmd.exe and do find or findstr command
string..
But doing this brings bad results.

All I need is the file names that contain the search string (item)

Does anyone have any ideas and sample code...

Thanks in advance for your time...

VB = 6.3
Office = 2003
XP