Book.Save("c:\reports\test.xls")
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("c:\reports\test.xls")
Dim st As XLS.Sheet = Book.Sheets(0)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Cells
Rg.EntireColumn.AutoFit
If st.Cols(4).Width > st.Cols(5).Width Then
st.Cols(5).Width = st.Cols(4).Width
Else
st.Cols(4).Width = st.Cols(5).Width
End If
App.Visible = True
4列和5列,哪个宽,取哪列,但没有效果,应该怎么写?