Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: cp932
- import win32api, win32con, win32com, win32com.client, os, time, sys
- excelApp = win32com.client.Dispatch("Excel.Application")
- excelApp.Visible = True
- excelApp.DisplayAlerts = False #警告メッセージをOFF
- #ブックを読み取り専用で開く
- book = excelApp.workbooks.open(sys.argv[1], False, True)
- for sheet in book.Worksheets:
- print sheet.name
- book.Close()
- excelApp.Quit()
Add Comment
Please, Sign In to add comment