Skip to content Skip to sidebar Skip to footer

Attributeerror: 'module' Object Has No Attribute 'open_openwork'

I want to import an EXCEL file ,but there is some wrong with the codes.Help! import xlrd fname = 'D:/pdf-ex/exc.xls' bk = xlrd.open_openwork('fname','rb') shxrange = range(bk.nshe

Solution 1:

The reason for that is because xlrd module does not have open_openwork() function in it.

The function you may be looking for is open_workbook():

open_workbook(...) - Open a spreadsheet file for data extraction.

Plus there is nothing about the mode in the docs - by providing second argument you set the log file (opened file object to which messages will be read).

So instead of:

bk = xlrd.open_openwork("fname","rb")

do:

bk = xlrd.open_workbook("fname")

Post a Comment for "Attributeerror: 'module' Object Has No Attribute 'open_openwork'"