Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Slow File Search

The code below slows down for several seconds because of
the "LastModified" line, and I can't figure out why, since
there are only a few dozen files involved here. If I take
out that one line, the code executes instantly. Any ideas?


Directory = Range("Inputsubdirectory").Value

On Error Resume Next
With Application.FileSearch
.NewSearch
.LookIn = Directory
.Filename = "*.xls*"
.LastModified = msoLastModifiedLastMonth
.SearchSubFolders = False
.Execute

End With



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Slow File Search

You have given Excel more work to do.
Are the files on a server ? Things usually happen slower if so.
I wonder if checking the date of each file before opening would b
faster. (VB FileDateTime function)

--
Message posted from http://www.ExcelForum.com

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
Excel file slow Scoop Excel Discussion (Misc queries) 1 March 14th 10 05:44 AM
File running slow! hoyos Excel Discussion (Misc queries) 6 January 31st 10 08:36 PM
file search or search files Richad Excel Discussion (Misc queries) 0 October 22nd 09 07:56 PM
file slow to save Smallweed Excel Discussion (Misc queries) 0 June 21st 07 12:07 PM
slow file to open pabs[_18_] Excel Programming 2 January 15th 04 05:16 AM


All times are GMT +1. The time now is 05:17 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"