使用python读取xls文件报错:xlrd.compdoc.CompDocError: Workbook corruption: seen[2] == 4

使用xlrd读取excel文件时, 出现异常:

xlrd.compdoc.CompDocError: Workbook corruption: seen[2] == 4
This error occurs, usually the source file has a problem, you can contact the author, but this is not wise, the following provides three ways to read the file.
解决方法一:

import xlwings as xw

 xl = Dispatch('Excel.Application')
 wb = xl.Workbooks.Open(file)
 ws = wb.Worksheets

猜你喜欢

转载自blog.csdn.net/dragon_T1985/article/details/121856724