Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
EA EA is offline
external usenet poster
 
Posts: 28
Default Application.Filesearch

Can anyone please advise why the code below worked with Excel 2000 but not
with Excel 2003?

With Application.FileSearch
.Filename = "C:\Test.xls"
If .Execute 0 Then
Workbooks.Open Filename:="C:\Text.xls"
End If
End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Application.Filesearch

FileSearch seems so flakey that it best avoided.
Use Dir or better GetAttr to determine if the file exists.

NickHK

"EA" ...
Can anyone please advise why the code below worked with Excel 2000 but not
with Excel 2003?

With Application.FileSearch
.Filename = "C:\Test.xls"
If .Execute 0 Then
Workbooks.Open Filename:="C:\Text.xls"
End If
End With




  #3   Report Post  
Posted to microsoft.public.excel.programming
EA EA is offline
external usenet poster
 
Posts: 28
Default Application.Filesearch

I always use DIR myself, but an inexperienced programmer asked me the
question below and I had not answer for him, especially when he
demonstrated.

I was hoping one of the MVPs would offer some input.


"NickHK" wrote in message
...
FileSearch seems so flakey that it best avoided.
Use Dir or better GetAttr to determine if the file exists.

NickHK

"EA"
...
Can anyone please advise why the code below worked with Excel 2000 but
not with Excel 2003?

With Application.FileSearch
.Filename = "C:\Test.xls"
If .Execute 0 Then
Workbooks.Open Filename:="C:\Text.xls"
End If
End With






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Application.Filesearch

The dubious results of FileSearch mean that you cannot rely on them.
Seems like MS have given up on it in the 2007 version anyway.
http://forums.microsoft.com/TechNet/...7153&SiteID=17

NickHK

"EA" wrote in message
...
I always use DIR myself, but an inexperienced programmer asked me the
question below and I had not answer for him, especially when he
demonstrated.

I was hoping one of the MVPs would offer some input.


"NickHK" wrote in message
...
FileSearch seems so flakey that it best avoided.
Use Dir or better GetAttr to determine if the file exists.

NickHK

"EA"
...
Can anyone please advise why the code below worked with Excel 2000 but
not with Excel 2003?

With Application.FileSearch
.Filename = "C:\Test.xls"
If .Execute 0 Then
Workbooks.Open Filename:="C:\Text.xls"
End If
End With








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
Application.FileSearch Cleberton(Brazilian) Excel Discussion (Misc queries) 2 October 26th 09 01:21 PM
Application.FileSearch malfunction?????? rznante Excel Programming 2 June 6th 06 04:52 PM
Application.FileSearch challenge Robin Clay[_4_] Excel Programming 3 March 3rd 06 08:56 PM
Help with Application.FileSearch method Roy Harrill Excel Programming 4 August 1st 05 12:56 AM
VBA Application.FileSearch Roger Frye Excel Programming 0 March 5th 04 04:07 AM


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