使用win32com.client计算Excel文件中的页数

ich*_*igo 3 python excel

使用win32com.client,如何计算excel文件中的所有页数?

ich*_*igo 6

找到了:

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
Run Code Online (Sandbox Code Playgroud)