不要循环
Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim Book As New XLS.Book(ProjectPath & "Attachments\业绩明细A.xls") '打开模板
Dim rpt As String = ProjectPath & "Reports\业绩明细A" & Tables("业绩填报").current("员工工号") & ".xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(7,12).Value = "<填报日期 >= #" & e.Form.Controls("DateTimePicker1").Value & "# And 填报日期 <= #" & e.Form.Controls("DateTimePicker2").Value & "#" '写入打印条件
Book.Build()
Book.Save(rpt)
wbr.OfficeToolBar = True '如果不需要显示工具栏,可删除此行代码
wbr.AddRess = rpt