LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default FileSearch, my code is way too slow

Hey Everyone,
I have a drive that holds about 20 folders, each of which contains anywhere
from 10-1000 tiff files. I have a program that, given a list of numbers,
goes in and finds the appropriate file and prints the drawing into the active
excel workbook and then prints off a hard copy. below, I have included a
portion of the code that I am using, i can include more if you like, but i
didn't want this to be too long. This seems to be the main hang-up area, it
just searches very slowly. Is there a bit of code that would search through
these files faster?

With Application.FileSearch
.NewSearch
.LookIn = "V:\" & foldername
.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If StrComp(.FoundFiles(i), revpath) 0 Then 'when code has gone
one part too far
If i = 1 Then 'i.e. if drawing even exist
MsgBox "Drawing " & myCell & " is not listed.", , "Sorry"
Exit For
Else
x = i - 1
'Print to excel file and so on


 
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
SLOW Code... Ernst Guckel[_4_] Excel Programming 2 March 20th 05 10:58 AM
Slow Code Frank Kabel Excel Programming 1 July 23rd 04 09:28 AM
Slow FileSearch Routine stratuser Excel Programming 0 May 14th 04 02:56 PM
Is this slow code? Tom Excel Programming 4 March 3rd 04 11:18 PM
FileSearch Code Pedro[_4_] Excel Programming 1 August 6th 03 02:27 PM


All times are GMT +1. The time now is 02:44 PM.

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

About Us

"It's about Microsoft Excel"