Dim Book As New XLS.Book(ProjectPath & "Attachments\标准模板.xls")
Dim Sheet As XLS.Sheet
Dim fl As String = ProjectPath & "Reports\标准模板.xls"
Book.Build() '生成细节区
sheet = book.sheets(0)
Dim App1 As New MSExcel.Application
Dim Wb1 As MSExcel.WorkBook = App1.WorkBooks.Open(ProjectPath & "Attachments\标准模板.xls")
Dim Ws1 As MSExcel.WorkSheet = Wb1.WorkSheets(1)
'Dim Rg As MSExcel.Range
'Dim Rg1 As MSExcel.Range
Ws1.UnProtect(Password:="hhh")
ws1.protect(Contents:= True,Scenarios:= True,AllowFormattingCells:= True,AllowFormattingColumns:= True, _
AllowFormattingRows:= True,AllowInsertingRows:= True,AllowDeletingColumns:= True,AllowDeletingRows:= True, _
AllowInsertingHyperlinks:= True,Password:="hhh")
wb1.save
app1.quit
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
甜老大:以上哪里不对?