请高手帮忙看看,谢谢
Private Sub Command2_Click()Dim EXAPP As Excel.Application
Dim WB As Excel.Workbook
Dim sht As Excel.Worksheet
Set EXAPP = CreateObject("excel.application")
Set WB = EXAPP.Workbooks.Open("d:\成绩表.xls")
Set sht = WB.Worksheets("总表")
sht.Range("U3").Select
ActiveCell.FormulaR1C1 = "=RANK(RC[-1],R3C20:R800C20)"
sht.Range("U3").Select
Selection.AutoFill Destination:=Range("U3:U800"), Type:=xlFillDefault
'WB.Save'保存编辑后的文件
WB.Close
Set sht = Nothing
Set WB = Nothing
Set EXAPP = Nothing
End Sub
运算过程中红色部分出错,请高手帮忙看看