我想用VBA按我要求次序打印一批EXCEL, 但當設定把工作表放入單一頁面打印出問題.
因VBA的With要輸入worksheet的名稱, 但每個excel的頁名都不同, 我嘗試用ActiveSheet代替也不行.
請高手大大指教怎解決
Set rrr = CreateObject("Scripting.FileSystemObject")
Workbooks.Open Filename:=(AAA + "\" + Cells(Range("L2").Value, 2).Text + "")
Range("C:E").Columns.AutoFit
Application.PrintCommunication = False
With ActiveSheet
.Zoom = False
.PageSetup.FitToPagesWide = 1
.PageSetup.FitToPagesTall = 0
End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.printout To:=1, Copies:=1, Collate:=True
ActiveWindow.Close saveChanges:=False