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() '生成细节区 Book.Save(fl) '保存工作簿 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 wb.save wb.close app.quit Dim Copyfl As String = "D:\按户计量单\" & Tables("汇报表").Current("村名称") & "(村)" & Tables("汇报表").Current("村寨名") & "(自然寨)" & Tables("汇报表").Current("组别") & "按户计量单" & ".xls" FileSys.CopyFile(fl, copyfl, True)