双击文件打开是正常显示的
Dim mb As String = ProjectPath & "Attachments\考核互评打分表.xls" '指定模板文件
Dim sc As String = ProjectPath & "Reports\考核互评打分表.xls" '指定目标文件
Dim t0 As String = Tables("绩效_考核_月份").Current("_Identify")
Dim Book As New XLS.Book(mb)
For i As Integer = 1 To 8
Dim s1 As DataRow = DataTables("绩效_考核_统分表").Find("编号1 = "& t0 &" And 部门 = '综合管理部' And 序号 = "& i &"")
Book.Marks.Add(I,s1("部门自评"))
Next
For i As Integer = 9 To 16
Dim s2 As DataRow = DataTables("绩效_考核_统分表").Find("编号1 = "& t0 &" And 部门 = '检测管理部' And 序号 = "& i &"")
Book.Marks.Add(I,s2("部门自评"))
Next
For i As Integer = 17 To 23
Dim s3 As DataRow = DataTables("绩效_考核_统分表").Find("编号1 = "& t0 &" And 部门 = '一室' And 序号 = "& i &"")
Book.Marks.Add(I,s3("部门自评"))
Next
For i As Integer = 24 To 30
Dim s4 As DataRow = DataTables("绩效_考核_统分表").Find("编号1 = "& t0 &" And 部门 = '三室' And 序号 = "& i &"")
Book.Marks.Add(I,s4("部门自评"))
Next
For i As Integer = 31 To 37
Dim s4 As DataRow = DataTables("绩效_考核_统分表").Find("编号1 = "& t0 &" And 部门 = '理化' And 序号 = "& i &"")
Book.Marks.Add(I,s4("部门自评"))
Next
Book.Build()
Book.Save(sc)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(sc)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
App.Visible = True
ShowAppWindow("考核互评打分表",2)
Ws.PrintPreview
App.Quit