Similar Threads
1. Application.FileSearch - how to define .LookIn
I am updating a Word 2000 macro to 2003.
I used Application.FileSearch to recover inserted data and replace it with
place holders at the end of the macro. (So that the base document can be
re-used).
Now however I can not get the the text file called "MonthData.txt" to be
found.
It is there (and is created by the macro) and in the same directory as
everything else.
In Word 2000 I had .LookIn as "C:\My Documents".
What do I need in Word 2003?
Is there a short cut to get to the working directory?
Thank you for looking at this for me. Sue
2. Lookin property of the FileSearch object
3. Filesearch .LookIn fixated on MyDocuments
Hello All,
Having made a habit of utilizing this newsgroup for "programming lessons",
and finding it invaluable, I finally have a question for which I cannot find
an answer. I think my answer is "find another way to do this without using
FileSearch." Yet, I must ask....
I am using typical FileSearch code (from this newsgroup) to locate the
latest file in a folder. In my application, this can be done via filenames
(mmyy at the beginning of each file in the folder). (Therein lies my answer)
The code worked a number of times with no problems, then starting giving the
following problem: The .LookIn value stays at "My Documents", (when moused
over while stepping through the code) instead of the coded folder on the
other side of the = sign. Anyone have any ideas on why this is happening?
With Application.FileSearch
.NewSearch
.LookIn = "C:\Some\Long\String\"
(mouse over .LookIn and get "C:\My Documents"
Looking forward to your experience and suggestions.
Randy
4. Problem with setting a R / W property, FileSearch, LookIn - Excel
5. 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
XXXX@XXXXX.COM (QQExcel) wrote in message news:< XXXX@XXXXX.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!
6. Cannot assign value to Filesearch.Lookin - Excel
7. application.filesearch generates run-time error '430'
Word 2003
Windows 2003 Server via Citrix
When I perform the following code on my home Windows 2003 machine all is
well. When I run it via Citrix (running on a Windows 2003 Server machine),
it stops on the very first line with a Run-time error '430'
With Application.FileSearch 'this is the line causing the error
.FileName = "foobar.txt"
.LookIn = "c:\temp"
.Execute
For I = 1 To .FoundFiles.Count
MsgBox .FoundFiles(I)
Next I
End With
Full text of error:
Microsoft Visual Basic
Run-time error '430':
Class does not support Automation or does not support expected interface
8. Application.FileSearch error - Office Word Programming