-- 作者:李睿涵
-- 发布时间:2015/10/13 12:07:00
--
Dim Book As New XLS.Book(ProjectPath & "Attachments\\Purchase Order.xls") Dim fl As String = ProjectPath & "Reports\\Purchase Order.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("D20:AV21")
Rg.WrapText = True \'Rg.EntireColumn.AutoFit \'自动调整列宽
Rg.EntireRow.AutoFit \'自动调整行高 App.Visible = True
Dim Proc As New Process \'打开工作簿 Proc.File = fl Proc.Start()
我是按这个顺序写的,执行后提示我,重复打开文件
|