var filePath =getCurrentDirectory()+"sta.xls"; var oXL = new ActiveXObject("Excel.application"); var oWB = oXL.Workbooks.open(filePath); oWB.worksheets(1).select(); var oSheet = oWB.ActiveSheet; var a = oSheet.usedrange.rows.count; .....在资源包