function openexcel(filename,sheetname,x,y)
Dim XFS,XFSBOOK,XFSSHEET
Set XFS = createobject("Excel.Application")
Set XFSBOOK = XFS.WorkBooks.Open(filename)
Set XFSSHEET = XFSBOOK.worksheets(sheetname)
return XFSSHEET.cells(x,y).value ‘这里报错
Set XFS=nothing
XFSBOOK.close
XFSSHEET.close
end function