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

I am using a macro with FileSearch in both office and
home computers. It works perfect in my office, but not
work at home. The problem is in FileSearch. The code is
as follow:

With Application.FileSearch
.NewSearch
.LookIn = FilePath
.FileName = SumBookName
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = True
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = FilePath +
SumBookName Then
FileExist = True
Exit For
End If
Next i
Else
FileExist = False
End If
End With

By using debug.print, I found Execue() is 0.
I am using same Excel 2002 at my office and home but at
differnt OS. Office is Windows2K, home is WinXP. What is
the problem? Anybody can help me?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default FileSearch Problem

I am sorry. It doesn't work.
SumBookName is an variable, can not pu "" around it.
I deleted FileType code, but it still doesn't work.
What can I do else?
Thanks.

Bin
-----Original Message-----
try commenting out
.FileType = msoFileTypeExcelWorkbooks
and/or put " " around sumbookname
.FileName = SumBookName
--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
I am using a macro with FileSearch in both office and
home computers. It works perfect in my office, but not
work at home. The problem is in FileSearch. The code is
as follow:

With Application.FileSearch
.NewSearch
.LookIn = FilePath
.FileName = SumBookName
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = True
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = FilePath +
SumBookName Then
FileExist = True
Exit For
End If
Next i
Else
FileExist = False
End If
End With

By using debug.print, I found Execue() is 0.
I am using same Excel 2002 at my office and home but at
differnt OS. Office is Windows2K, home is WinXP. What is
the problem? Anybody can help me?



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default FileSearch Problem

Sorry. I can not use a real file name. It is input by
user. Since I am using the same Excel 2002, same CD, for
both computers with different OS, is it OS problem?
-----Original Message-----
try it using a real file name like
thisismyfile.xls

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
I am sorry. It doesn't work.
SumBookName is an variable, can not pu "" around it.
I deleted FileType code, but it still doesn't work.
What can I do else?
Thanks.

Bin
-----Original Message-----
try commenting out
.FileType = msoFileTypeExcelWorkbooks
and/or put " " around sumbookname
.FileName = SumBookName
--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
I am using a macro with FileSearch in both office and
home computers. It works perfect in my office, but

not
work at home. The problem is in FileSearch. The code

is
as follow:

With Application.FileSearch
.NewSearch
.LookIn = FilePath
.FileName = SumBookName
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = True
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = FilePath +
SumBookName Then
FileExist = True
Exit For
End If
Next i
Else
FileExist = False
End If
End With

By using debug.print, I found Execue() is 0.
I am using same Excel 2002 at my office and home but

at
differnt OS. Office is Windows2K, home is WinXP.

What is
the problem? Anybody can help me?


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default FileSearch Problem

May be.

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
Sorry. I can not use a real file name. It is input by
user. Since I am using the same Excel 2002, same CD, for
both computers with different OS, is it OS problem?
-----Original Message-----
try it using a real file name like
thisismyfile.xls

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
I am sorry. It doesn't work.
SumBookName is an variable, can not pu "" around it.
I deleted FileType code, but it still doesn't work.
What can I do else?
Thanks.

Bin
-----Original Message-----
try commenting out
.FileType = msoFileTypeExcelWorkbooks
and/or put " " around sumbookname
.FileName = SumBookName
--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bin" wrote in message
...
I am using a macro with FileSearch in both office and
home computers. It works perfect in my office, but

not
work at home. The problem is in FileSearch. The code

is
as follow:

With Application.FileSearch
.NewSearch
.LookIn = FilePath
.FileName = SumBookName
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = True
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = FilePath +
SumBookName Then
FileExist = True
Exit For
End If
Next i
Else
FileExist = False
End If
End With

By using debug.print, I found Execue() is 0.
I am using same Excel 2002 at my office and home but

at
differnt OS. Office is Windows2K, home is WinXP.

What is
the problem? Anybody can help me?


.



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default FileSearch Problem

There have been lots of posts that say that .filesearch is flakey in xl2002.
And some posts that say it's even worse under winXP.



Bin wrote:

I am using a macro with FileSearch in both office and
home computers. It works perfect in my office, but not
work at home. The problem is in FileSearch. The code is
as follow:

With Application.FileSearch
.NewSearch
.LookIn = FilePath
.FileName = SumBookName
.FileType = msoFileTypeExcelWorkbooks
.MatchTextExactly = True
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) = FilePath +
SumBookName Then
FileExist = True
Exit For
End If
Next i
Else
FileExist = False
End If
End With

By using debug.print, I found Execue() is 0.
I am using same Excel 2002 at my office and home but at
differnt OS. Office is Windows2K, home is WinXP. What is
the problem? Anybody can help me?


--

Dave Peterson

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
FileSearch Excel 2007 shaz Excel Discussion (Misc queries) 4 March 21st 10 02:07 AM
Application.FileSearch Cleberton(Brazilian) Excel Discussion (Misc queries) 2 October 26th 09 01:21 PM
Lookin property of the FileSearch object [email protected] New Users to Excel 0 December 5th 06 09:37 PM
FileSearch in a combo box michaelberrier Excel Discussion (Misc queries) 0 June 16th 06 12:21 AM
Exclude directory from .FileSearch MacroMan Excel Programming 0 July 21st 03 07:38 PM


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