Dim dr As DataRow = Tables("推荐类型").current.DataRow Dim path As String If dr("推荐类型") = "民主推荐" Or dr("推荐类型") = "二次推荐" Then path = "Attachments\推荐登记表.xls" Else If dr("推荐类型") = "谈话推荐" Then path = "Attachments\谈话推荐登记表.xls" Else msgbox("没有相应的Excel模板!") End If If path > "" Then Dim Book As New XLS.Book(ProjectPath & path) Dim fl As String = ProjectPath & "Reports\推荐登记表.xls" Book.Build() '生成细节区 Book.Save(fl) '保存工作簿 Dim Proc As New Process '打开工作簿 Proc.File = fl Proc.Start() End If
|