首先异步里去掉DataTables("翻译内容").StopRedraw、Dim dr As DataRow = DataTables("Table1").AddNew这些用法:http://www.foxtable.com/mobilehelp/topics/277.htm
然后日志参考:
http://www.foxtable.com/webhelp/topics/0435.htm
比如:
Dim wb As MsExcel.WorkBook
Dim WS As MsExcel.WorkSheet
try
wb=app.WorkBooks.open(file)
Output.Logs("日志").Add("打开文件" & file & Date.Now )
For k As Integer=1 To wb.worksheets.Count
Ws=Wb.WorkSheets(k)
Output.Logs("日志").Add("处理sheet" & k & Date.Now )
Dim Rg As MSExcel.Range = Ws.UsedRange
'lbl9.text = "Sheet名称:" & " " & Ws.name
If rg.Count = 1 And rg(1).Value Is Nothing Then
Continue For
End If
If Numcb2.Text = Nothing And Numcb3.Text = Nothing Then
Output.Logs("日志").Add("开始xxx操作" & Date.Now )
RowsMax = 0
ColsMax = 0
'获取最大行
For i As Integer = 1 To rg.Columns.count
Dim r = ws.cells(excelrows,i).End(MsExcel.XlDirection.xlUp).Row
If r > RowsMax Then
RowsMax = r
End If
Next
……
finally
If ws IsNot Nothing Then ws = Nothing
If Wb IsNot Nothing Then Wb.Close(Type.Missing, Type.Missing, Type.Missing)
If Wb IsNot Nothing Then Wb = Nothing
Output.Logs("日志").Save("c:\log.txt",True)
Output.Logs("日志").Clear
End try
End If