Sub 打印指定文件()
Dim iPath$, iName$, Wb As Workbook
Dim i
iPath = ThisWorkbook.Path & '\'
iName = Dir(iPath & '*.xls*')
On Error Resume Next
Do While iName <> ''
If iName <> ThisWorkbook.Name Then
Set Wb = Workbooks.Open(iPath & iName)
For i = 1 To Wb.Worksheets.Count
Wb.Worksheets(i).PrintOut
Next
Wb.Close False
End If
iName = Dir
Loop
End Sub
联系客服