If Forms("窗口").Opened Then '不知道打印窗口表和打印按钮是不是在一个窗口,如果不是加上这句 Tables("窗口名_Table1").Filter= "勾选列 = True" '先筛选勾选的数据 Tables("窗口名_Table1").Select(0, 0, Tables("窗口名_Table1").Rows.Count - 1, Tables("窗口名_Table1").Cols.Count - 1) '选定筛选后的数据 Dim book As New XLS.Book( ProjectPath & "Attachments\出库单.xls") Dim rpt As String = ProjectPath & "Reports\出库单.xls" Book.Build() Book.Save(rpt) Dim Proc As New Process '打开工作簿 Proc.File = rpt Proc.Start() End If
|