如何在以下命令中、加入判断条件,如果出现报错情况就终止后续的轮巡命令,避免老是重复弹出同一个错误
Dim dt1 As Date
dt1 = Date.Now
For i As Integer = 0 To Tables("拆分条件表").Rows.count - 1
Tables("拆分条件表").Position = i
Dim r As Row = Tables("拆分条件表").Rows(i)
Dim Book As New XLS.Book(ProjectPath & "Attachments\装维工资奖惩确认表.xlsx") '打开模板
'Dim fl As String = ProjectPath & "Reports\" & r("列表项目1") & ".xls"
Dim fl As String = "D:\拆分\装维工作量确认表\EXL表\" & e.Form.Controls("输出文件命名").text &"-"& r("区县名称") &"-"& r("网格名称") & "网格.xlsx" '指定目标文件
Dim fl1 As String = "D:\拆分\装维工作量确认表\PDF表\" & e.Form.Controls("输出文件命名").text &"-"& r("区县名称") &"-"& r("网格名称") & "网格.PDF" '指定目标文件
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Book.Build() '生成报表
Book.Save(fl)
Book.Save(fl1)
Next
MessageBox.show("完成【装维工资奖惩确认表】拆分工作!!!", "非常关键提醒")
此主题相关图片如下:22.png