Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fix???

The following code worked in Excel 97 but not worked in Excel 2003, why why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fix???

It does work in 2003, but does not in 2007. Your variable ...

..filename = "S:\list_file.xls"

.... should be ...

..Filename = "list_file.xls"
..LookIn = "S:\"

HTH

--
Zack Barresse




"August 8" wrote in message
...
The following code worked in Excel 97 but not worked in Excel 2003, why
why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fi

Thanks.

It runs without error in 2003 but give me wrong result:
the file does not exist!!
(The same code run in 97 without any error and give me correct result!)

If I use .LookIn
it give me "compile error: Invalid use of property"...


"Zack Barresse" wrote:

It does work in 2003, but does not in 2007. Your variable ...

.filename = "S:\list_file.xls"

... should be ...

.Filename = "list_file.xls"
.LookIn = "S:\"

HTH

--
Zack Barresse




"August 8" wrote in message
...
The following code worked in Excel 97 but not worked in Excel 2003, why
why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fi

Sorry, my mistake, forgot the "=" after ".LookIn"
but why I have to use ".LookIn"?

Thanks!

"August 8" wrote:

Thanks.

It runs without error in 2003 but give me wrong result:
the file does not exist!!
(The same code run in 97 without any error and give me correct result!)

If I use .LookIn
it give me "compile error: Invalid use of property"...


"Zack Barresse" wrote:

It does work in 2003, but does not in 2007. Your variable ...

.filename = "S:\list_file.xls"

... should be ...

.Filename = "list_file.xls"
.LookIn = "S:\"

HTH

--
Zack Barresse




"August 8" wrote in message
...
The following code worked in Excel 97 but not worked in Excel 2003, why
why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fi

You don't have to use the LookIn property. It's been a while since I used
the FileSearch method (mostly because I'm predominantly 2007 now) but if you
didn't specify where to look you may be off in la-la land looking for the
file(s).

--
Zack Barresse



"August 8" wrote in message
...
Sorry, my mistake, forgot the "=" after ".LookIn"
but why I have to use ".LookIn"?

Thanks!

"August 8" wrote:

Thanks.

It runs without error in 2003 but give me wrong result:
the file does not exist!!
(The same code run in 97 without any error and give me correct result!)

If I use .LookIn
it give me "compile error: Invalid use of property"...


"Zack Barresse" wrote:

It does work in 2003, but does not in 2007. Your variable ...

.filename = "S:\list_file.xls"

... should be ...

.Filename = "list_file.xls"
.LookIn = "S:\"

HTH

--
Zack Barresse




"August 8" wrote in message
...
The following code worked in Excel 97 but not worked in Excel 2003,
why
why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub




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
Major gridlines - worked great on Excel 2003 but not 2007 HGood Charts and Charting in Excel 0 August 13th 09 07:25 PM
Excel 2007 Auto Login Problem worked with 2003 pops69 Excel Discussion (Misc queries) 0 June 25th 07 02:15 PM
Filesearch in 2003 David Excel Programming 1 March 10th 06 04:16 PM
Vacation accrual based on hours worked - Excel 2003 CCB AA Excel Worksheet Functions 1 December 20th 05 08:39 PM
Having trouble totaling columns in excel 2003, always worked b4 rjmac Excel Worksheet Functions 1 June 24th 05 07:01 PM


All times are GMT +1. The time now is 07:17 PM.

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"