Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
win32com.client を使用して、Excel ファイルのすべてのシート数をカウントするにはどうすればよいですか?
それを見つけた:
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