Print all Sheet2 of all Workbooks in Folder
On Nov 18, 8:13*am, u473 wrote:
This little module crashes on "With Application.FileSearch".
That may not be the real culprit, but I have not found what is wrong.
Thank you for your help.
.
Sub PrintAllWS2()
Dim i As Long
Dim WB As Workbook
Application.ScreenUpdating = False
With Application.FileSearch
* * .NewSearch
* * .LookIn = "F:\VBA845\"
* * .SearchSubFolders = False
* * .FileType = msoFileTypeExcelWorkbooks
* * For i = 1 To .FoundFiles.Count
* * * * Set WB = Workbooks.Open(.FoundFiles(i))
* * * * Sheets("Sheet2").PrintOut
* * * * WB.Close False
* * *Next i
End With
Application.ScreenUpdating = True
End Sub
I tried your code with Excel 2000.... Got through without error. ps.
Of course it didn't find any files
|