Dim App As New MSExcel.Application
dim cm as integer =1
Dim u As Table = Tables("销售开piao明细")For i As Integer = 0 To u.Rows.count - 1 step 80 Dim Wb As MSExcel.Workbook = App.WorkBooks.Open(ProjectPath & "Attachments\全电fa piao.xlsx") Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets("明细模板") Dim r As Integer Dim m As Integer = 1
for j as integer = 0 to 79
if i+j < u.Rows.count - 1
Dim u1 As Row = u.Rows(i+j)
Ws.Range("A" & m + 4).Value = u1("开piao品名")''''''货物名称
Ws.Range("H" & m + 4).Value = u1("税率")''''''税率
m += 1
end if
next
Wb.SaveAs("D:\" & cm & ".xls")
cm += 1
Wb.close
next
App.quit