Dim Book As New XLS.Book(ProjectPath & "Attachments\计量单.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Dim fl As String = ProjectPath & "Reports\计量单.xls"
Book.Build() '生成细节区
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Range("C:C")
rg.Formula = rg.Formula
Dim Copyfl As String = "D:\按户计量单\" & Tables("汇报表").Current("村名称") & "(村)" & Tables("汇报表").Current("村寨名") & "(自然寨)" & Tables("汇报表").Current("组别") & "按户计量单" & ".xls"
FileSys.CopyFile(fl, copyfl, True)
Book.Save(fl) '保存工作簿
wb.close
app.quit
wb.close不是关闭计量单吗?
Book.Save(fl) '保存工作簿有这条语句也提示,是不是对计量单保存更改
[此贴子已经被作者于2018/6/6 11:07:32编辑过]