Book As New XLS.Book '定义一个Excel工作簿 Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表 With Sheet.PrintSetting '页眉左边为日期,中间为时间,右边为表名 .Header = "&L&D &C&T &R&A" '在页脚右边打印页号和总页数 .Footer = "&R第&P页,总&N页" End With For i As Integer = 0 To 100 '向工作表的单元格中设置值 Sheet(i, 0).Value = (i + 1) * 10 Sheet(i, 1).Value = (i + 1) * 100 Sheet(i, 2).Value = (i + 1) * 1000 Next Book.Save("c:\reports\test.xls") '保存工作簿 Dim Proc As New Process '打开工作簿 Proc.File = "c:\reports\test.xls" Proc.Start()