Using the VBA script, use the following: Create a new document, paste the code into the VBA project, and then run it, in the case of an Excel document that needs to be printed in bulk.
The specific code is as follows:
Attribute Vb_name ="Module 1"Subpiliangpring () Attribute PiLiangPring.VB_ProcData.VB_Invoke_Func="\n14"DimCurpath as StringCurpath= Thisworkbook.path &"\"DimXlsfile as StringXlsfile=Dir(Curpath &"*.xls") whileXlsfile <>"" IfXlsfile <> Thisworkbook.name ThenExcel.Application.Workbooks.Open (Curpath&xlsfile)'Activate the latest workbookExcel.Application.Workbooks (Excel.Application.Workbooks.Count). Activate'set the paper type to A4Excel.Application.Workbooks (Excel.Application.Workbooks.Count). ActiveSheet.PageSetup.PaperSize =9 'Print orientation set to landscapeExcel.Application.Workbooks (Excel.Application.Workbooks.Count). ActiveSheet.PageSetup.Orientation =2 'Print only the active worksheetExcel.Application.Workbooks (Excel.Application.Workbooks.Count). Activesheet.printout Excel.Application.Workbooks (xlsfile). Close (False) End IfXlsfile=DirWendMsgBox("Print Done")End Sub
Batch horizontal Print Excel