PC Review


Reply
Thread Tools Rate Thread

"application.filesearch" object doesn't support the this property or method

 
 
Sebation.G
Guest
Posts: n/a
 
      2nd Jun 2007
i have many workbooks in the same folder,like "e:\data",i want to write
value in the same address in each workbook.
so i write this code:
==================================
Sub test()
Dim wbOpen As Workbook
Dim ws As Worksheet
Dim I As Long

With Application.FileSearch
.NewSearch
.LookIn = "e:\data"
.FileType = msoFileTypeExcelWorkbooks
.Execute
For I = 1 To .FoundFiles.Count
Set wbOpen = Workbooks.Open(.FoundFiles(I))
Set ws = wbOpen.Worksheets(1)
ws.Range("a10") = 10
Next I
End With
End Sub
==================================
while it's can't run and gives the error message"object doesn't support this
property or method".
i use office 2007.
can anyone give me a guaidance.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      2nd Jun 2007
I used your code, only changing the path to "C:\temp" and it worked without
error.
Using Excel 2002. The problem might not be in the code.
--
Gary''s Student - gsnu200726


"Sebation.G" wrote:

> i have many workbooks in the same folder,like "e:\data",i want to write
> value in the same address in each workbook.
> so i write this code:
> ==================================
> Sub test()
> Dim wbOpen As Workbook
> Dim ws As Worksheet
> Dim I As Long
>
> With Application.FileSearch
> .NewSearch
> .LookIn = "e:\data"
> .FileType = msoFileTypeExcelWorkbooks
> .Execute
> For I = 1 To .FoundFiles.Count
> Set wbOpen = Workbooks.Open(.FoundFiles(I))
> Set ws = wbOpen.Worksheets(1)
> ws.Range("a10") = 10
> Next I
> End With
> End Sub
> ==================================
> while it's can't run and gives the error message"object doesn't support this
> property or method".
> i use office 2007.
> can anyone give me a guaidance.
>
>
>

 
Reply With Quote
 
Sebation.G
Guest
Posts: n/a
 
      2nd Jun 2007
thanks for your reply/
i have tried it in the excel2003 ,as u said it does work well,while in the
excel 2007,it gets wrong.

anyone who uses excel 2007 can run this code?
"Gary''s Student" <(E-Mail Removed)> дÈëÏûÏ¢ÐÂÎÅ:58025DDA-8398-4576-99C3-(E-Mail Removed)...
>I used your code, only changing the path to "C:\temp" and it worked without
> error.
> Using Excel 2002. The problem might not be in the code.
> --
> Gary''s Student - gsnu200726
>
>
> "Sebation.G" wrote:
>
>> i have many workbooks in the same folder,like "e:\data",i want to write
>> value in the same address in each workbook.
>> so i write this code:
>> ==================================
>> Sub test()
>> Dim wbOpen As Workbook
>> Dim ws As Worksheet
>> Dim I As Long
>>
>> With Application.FileSearch
>> .NewSearch
>> .LookIn = "e:\data"
>> .FileType = msoFileTypeExcelWorkbooks
>> .Execute
>> For I = 1 To .FoundFiles.Count
>> Set wbOpen = Workbooks.Open(.FoundFiles(I))
>> Set ws = wbOpen.Worksheets(1)
>> ws.Range("a10") = 10
>> Next I
>> End With
>> End Sub
>> ==================================
>> while it's can't run and gives the error message"object doesn't support
>> this
>> property or method".
>> i use office 2007.
>> can anyone give me a guaidance.
>>
>>
>>



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      2nd Jun 2007
They remove FileSearch in 2007 because it is not working correct sometimes.
See this page for another example
http://www.rondebruin.nl/copy4.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Sebation.G" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> thanks for your reply/
> i have tried it in the excel2003 ,as u said it does work well,while in the excel 2007,it gets wrong.
>
> anyone who uses excel 2007 can run this code?
> "Gary''s Student" <(E-Mail Removed)> дÈëÏûÏ¢ÐÂÎÅ:58025DDA-8398-4576-99C3-(E-Mail Removed)...
>>I used your code, only changing the path to "C:\temp" and it worked without
>> error.
>> Using Excel 2002. The problem might not be in the code.
>> --
>> Gary''s Student - gsnu200726
>>
>>
>> "Sebation.G" wrote:
>>
>>> i have many workbooks in the same folder,like "e:\data",i want to write
>>> value in the same address in each workbook.
>>> so i write this code:
>>> ==================================
>>> Sub test()
>>> Dim wbOpen As Workbook
>>> Dim ws As Worksheet
>>> Dim I As Long
>>>
>>> With Application.FileSearch
>>> .NewSearch
>>> .LookIn = "e:\data"
>>> .FileType = msoFileTypeExcelWorkbooks
>>> .Execute
>>> For I = 1 To .FoundFiles.Count
>>> Set wbOpen = Workbooks.Open(.FoundFiles(I))
>>> Set ws = wbOpen.Worksheets(1)
>>> ws.Range("a10") = 10
>>> Next I
>>> End With
>>> End Sub
>>> ==================================
>>> while it's can't run and gives the error message"object doesn't support this
>>> property or method".
>>> i use office 2007.
>>> can anyone give me a guaidance.
>>>
>>>
>>>

>
>


 
Reply With Quote
 
Sebation.G
Guest
Posts: n/a
 
      2nd Jun 2007
thanks for you reply.it is very useful.
"Ron de Bruin" <(E-Mail Removed)>
??????:(E-Mail Removed)...
> They remove FileSearch in 2007 because it is not working correct
> sometimes.
> See this page for another example
> http://www.rondebruin.nl/copy4.htm
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Sebation.G" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> thanks for your reply/
>> i have tried it in the excel2003 ,as u said it does work well,while in
>> the excel 2007,it gets wrong.
>>
>> anyone who uses excel 2007 can run this code?
>> "Gary''s Student" <(E-Mail Removed)>
>> дÈëÏûÏ¢ÐÂÎÅ:58025DDA-8398-4576-99C3-(E-Mail Removed)...
>>>I used your code, only changing the path to "C:\temp" and it worked
>>>without
>>> error.
>>> Using Excel 2002. The problem might not be in the code.
>>> --
>>> Gary''s Student - gsnu200726
>>>
>>>
>>> "Sebation.G" wrote:
>>>
>>>> i have many workbooks in the same folder,like "e:\data",i want to write
>>>> value in the same address in each workbook.
>>>> so i write this code:
>>>> ==================================
>>>> Sub test()
>>>> Dim wbOpen As Workbook
>>>> Dim ws As Worksheet
>>>> Dim I As Long
>>>>
>>>> With Application.FileSearch
>>>> .NewSearch
>>>> .LookIn = "e:\data"
>>>> .FileType = msoFileTypeExcelWorkbooks
>>>> .Execute
>>>> For I = 1 To .FoundFiles.Count
>>>> Set wbOpen = Workbooks.Open(.FoundFiles(I))
>>>> Set ws = wbOpen.Worksheets(1)
>>>> ws.Range("a10") = 10
>>>> Next I
>>>> End With
>>>> End Sub
>>>> ==================================
>>>> while it's can't run and gives the error message"object doesn't support
>>>> this
>>>> property or method".
>>>> i use office 2007.
>>>> can anyone give me a guaidance.
>>>>
>>>>
>>>>

>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: ActiveX "Object doesn't support this property or method" error Leon Lambert Microsoft C# .NET 0 13th Mar 2009 10:11 AM
Re: ActiveX "Object doesn't support this property or method" error Pavel Minaev Microsoft C# .NET 1 12th Mar 2009 11:46 PM
"Object doesn't support this property or method" in Excel 2003 rhiski12 Microsoft Excel Misc 3 24th Nov 2008 03:58 PM
"Object doesn't support this property or method" Error on Tree Con Lee Vance Microsoft Access VBA Modules 0 5th Mar 2008 02:20 PM
Referenced object on subform gets "object doesn't support this property or method" Brandon Schultz Microsoft Access Forms 1 1st Feb 2007 05:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 PM.