找到了: excel = win32.gencache.EnsureDispatch('Excel.Application') try: wb = excel.Workbooks.Open(file) except: print "Failed to open spreadsheet " + file sys.exit(1) count = wb.Sheets.Count