没做测试应该是range.Rows.AutoFit();
你这里的Cells可能得做一下转化,你自己试一下

解决方案 »

  1.   

    oSheet.Cells(6,2).value = tableTmp.rows(i).cells(2).innerText; 
    oSheet.Cells(8,4).value = tableTmp.rows(i).cells(3).innerText; 
    oSheet.Cells(9,4).value = tableTmp.rows(i).cells(4).innerText; 
    oSheet.Cells(10,4).value = tableTmp.rows(i).cells(5).innerText;
    oSheet.Cells(11,4).value = tableTmp.rows(i).cells(6).innerText; oSheet.Cells(trueR+1,t+1).rowheight=30
    oSheet.Cells(trueR+2,t+1).Borders.LineStyle=1
    oSheet.Cells(trueR+2,t+1).horizontalAlignment=-4108
    oSheet.Cells(trueR+2,t+1).VerticalAlignment= -4108 
    oSheet.Cells(trueR+2,t+1).font.Name = "宋体"
    oSheet.Cells(trueR+1,t+1).font.FontStyle = "加粗"
    自动行高??