U
u473
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
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