改成这样
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("D:\test.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
wb.saved = True
App.Visible = True
Ws.PrintPreview
App.Quit
上面是打印预览,直接打印,改成
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("D:\test.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
wb.saved = True
Ws.PrintOut
App.Quit
[此贴子已经被作者于2017/12/27 15:24:13编辑过]