Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "文本文件|*.txt" '设置筛选器
dlg.FileName = "出库单" & Formst(Date.Today,"yyyyMMdd") & ".xls"
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim Book As New XLS.Book(ProjectPath & "Attachments\出库单.xls")
Dim fl As String = dlg.FileName
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If