0

Python is generating this error by reading the excel file by all the method i.e pandas, openpyxl.

raise CompDocError(msg) xlrd.compdoc.CompDocError: MSAT extension: accessing sector 131072 but only 22863 in file

AUHS
  • 11
  • 3

1 Answers1

0

I had the same problem and solved with this answer:

#!pip install OleFileIO-PL
import OleFileIO_PL
import pandas as pd

path = 'file.xls'
with open(path,'rb') as file:
    ole = OleFileIO_PL.OleFileIO(file)
    if ole.exists('Workbook'):
        d = ole.openstream('Workbook')
        x=pd.read_excel(d,engine='xlrd')
        print(x.head())
rodriper
  • 626
  • 7
  • 9