Dim Book As New XLS.Book(ProjectPath & "Attachments\订单计划一览表.xls")
Dim fl As String = ProjectPath & "Reports\订单计划一览表.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
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.Cells
Rg.WrapText = True
'Rg.EntireColumn.AutoFit '自动调整列宽
Rg.EntireRow.AutoFit '自动调整行高
App.Visible = True
[此贴子已经被作者于2017/5/25 18:02:57编辑过]