Dim fl As String = "d:\test.xls"
Tables("T101").SaveExcel(fl, "73487")
Dim Book As New XLS.Book(fl)
Dim s As XLS.Sheet = book.Sheets(0)
For j As Integer = 0 To s.Cols.Count - 1
If s(0, j).Text = "设备状态" Then
For i As Integer = 1 To s.Rows.Count - 1
If s(i, j).Text = "0" Then
s(i, j).Value = "正常"
ElseIf s(i, j).Text = "1" Then
s(i, j).Value = "不正常"
End If
Next
End If
Next
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
使用这个代码可以用数据字典的正常和不正常来代替0和1,可是我想它按照做好的Excel模板来生成,请问那么应该怎样改呢?