1

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

AUHS
  • 11
  • 3

2 Answers2

0

You might be trying to open a corrupt Excel file. Assuming you're opening the file using xlrd, you could try adding the ignore_workbook_corruption=True parameter:

workbook = xlrd.open_workbook('file_name.xls', ignore_workbook_corruption=True)
Deneb
  • 981
  • 2
  • 9
  • 25
0

I solved the same problem with this solution:

#!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