Dim Book As New XLS.Book '定义一个Excel工作簿 Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表 With Sheet.PrintSetting .Header = "&L&'制表日期:&D &C&D&' 佳信公司工资表&B&U&E"
.Footer = "&C第&P页,总&N页 &R&[18]&'制表人:" 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:\234.xls") '保存工作簿 Dim Proc As New Process '打开工作簿 Proc.File = "c:\234.xls" Proc.Start()