Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cannot assign value to Filesearch.Lookin

Hello, everone,

I just posted this and something wrong w/ my computer, sorry if I post
it twice.

I have a problem with assiging file path to .LookIn. I saw couple
messages regard to it but still don't get it. Any help would
appreciate.

Here is my code:

FilePath = ThisWorkbook.Path & "\Phase1_Comments\"

Set FS = Application.FileSearch
With FS
.LookIn = """" & FilePath & """"
.FileName = FileSpec
.Execute
If .FoundFiles.Count = 0 Then
MsgBox "No files were found, ...."
Exit Sub
End If
End With

ThisWorkbook.Path is as http"//servername/.../
..LookIn is still as C:\documents and settings\ after running.

This code is in workbook event - SheetFollowHyperlink

My excel is 2000.

Thanks a lot!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cannot assign value to Filesearch.Lookin

lose all the quotes. Filepath is already a string

.Lookin = filepath

--
Regards,
Tom Ogilvy

"QQExcel" wrote in message
om...
Hello, everone,

I just posted this and something wrong w/ my computer, sorry if I post
it twice.

I have a problem with assiging file path to .LookIn. I saw couple
messages regard to it but still don't get it. Any help would
appreciate.

Here is my code:

FilePath = ThisWorkbook.Path & "\Phase1_Comments\"

Set FS = Application.FileSearch
With FS
.LookIn = """" & FilePath & """"
.FileName = FileSpec
.Execute
If .FoundFiles.Count = 0 Then
MsgBox "No files were found, ...."
Exit Sub
End If
End With

ThisWorkbook.Path is as http"//servername/.../
.LookIn is still as C:\documents and settings\ after running.

This code is in workbook event - SheetFollowHyperlink

My excel is 2000.

Thanks a lot!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cannot assign value to Filesearch.Lookin

Thanks Tom!

But it still doesn't work. Actually, I tried that first and then add
the quotes. Neither of them work.


Christine

"Tom Ogilvy" wrote in message ...
lose all the quotes. Filepath is already a string

.Lookin = filepath

--
Regards,
Tom Ogilvy

"QQExcel" wrote in message
om...
Hello, everone,

I just posted this and something wrong w/ my computer, sorry if I post
it twice.

I have a problem with assiging file path to .LookIn. I saw couple
messages regard to it but still don't get it. Any help would
appreciate.

Here is my code:

FilePath = ThisWorkbook.Path & "\Phase1_Comments\"

Set FS = Application.FileSearch
With FS
.LookIn = """" & FilePath & """"
.FileName = FileSpec
.Execute
If .FoundFiles.Count = 0 Then
MsgBox "No files were found, ...."
Exit Sub
End If
End With

ThisWorkbook.Path is as http"//servername/.../
.LookIn is still as C:\documents and settings\ after running.

This code is in workbook event - SheetFollowHyperlink

My excel is 2000.

Thanks a lot!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cannot assign value to Filesearch.Lookin....still not working

I changed my code as following, but still nor working....

FilePath = ThisWorkbook.Path & "\Phase1_Comments\"

Set FS = Application.FileSearch
With FS
.LookIn = FilePath
.FileName = FileSpec
.Execute
If .FoundFiles.Count = 0 Then
MsgBox "No files were found, ...."
Exit Sub
End If
End With

ThisWorkbook.Path is as http"//servername/.../
.LookIn is still as C:\documents and settings\ after running.

Thanks a lot!

regards,
Christine

(QQExcel) wrote in message . com...
Hello, everone,

I just posted this and something wrong w/ my computer, sorry if I post
it twice.

I have a problem with assiging file path to .LookIn. I saw couple
messages regard to it but still don't get it. Any help would
appreciate.

Here is my code:

FilePath = ThisWorkbook.Path & "\Phase1_Comments\"

Set FS = Application.FileSearch
With FS
.LookIn = """" & FilePath & """"
.FileName = FileSpec
.Execute
If .FoundFiles.Count = 0 Then
MsgBox "No files were found, ...."
Exit Sub
End If
End With

ThisWorkbook.Path is as http"//servername/.../
.LookIn is still as C:\documents and settings\ after running.

This code is in workbook event - SheetFollowHyperlink

My excel is 2000.

Thanks a lot!

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
Lookin property of the FileSearch object [email protected] New Users to Excel 0 December 5th 06 09:37 PM
can not assign value to LookIn QQExcel Excel Programming 1 July 30th 04 07:44 PM
Lookin Property. Simon[_14_] Excel Programming 3 April 20th 04 02:17 PM
.FileSearch Randall[_3_] Excel Programming 4 November 26th 03 01:48 AM
Using a variable with .LookIn Mike Berry Excel Programming 0 July 14th 03 12:29 PM


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