Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default "application.filesearch" object doesn't support the this property or method

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default "application.filesearch" object doesn't support the this property

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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default "application.filesearch" object doesn't support the this property

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" ...
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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default "application.filesearch" object doesn't support the this property

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" wrote in message ...
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" ...
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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default "application.filesearch" object doesn't support the this property

thanks for you reply.it is very useful.
"Ron de Bruin"
...
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" wrote in message
...
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"
...
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
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
"Object doesn't support this property or method" in Excel 2003 rhiski12 Excel Discussion (Misc queries) 3 November 24th 08 03:58 PM
VBA error: "object doesn't support this property or method" Dave F Excel Discussion (Misc queries) 2 April 23rd 07 06:04 PM
Help "438 - Object doesn't support this property or method" Revtim Excel Programming 0 September 7th 05 04:57 PM
Why "object doesn't suppor this property or method"? davegb Excel Programming 5 September 2nd 05 11:01 PM
"Select Column method or property not available because some/all of object doesn't refer to table" Steven Rosenberg Excel Programming 0 August 18th 03 04:41 AM


All times are GMT +1. The time now is 07:02 AM.

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"