S
Sebation.G
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.
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.