Dim dlg As New SaveFileDialog '定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls" '设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim Book As New XLS.Book(ProjectPath & "Attachments\报表1.xls") Dim fl As String = dlg.FileName Dim Sheet As XLS.Sheet = Book.Sheets(0) Sheet(3,9).Value = "<" & Tables("检查").Filter & ">" '写入打印条件 Book.Build() '生成细节区 Book.Save(fl) '保存工作簿 Dim Proc As New Process Proc.File = fl Proc.Start() End If
|