I have a workbook of 12 sheet and every sheet has some value in column A. All the useful information starts from row 9 column 0 of every sheet. Once the cell (AX,0) has no data it should move to the next sheet. Here num is the number of sheet in the workbook. The code is below:
workbook = xlrd.open_workbook('example.xlsx')
row = 9
num = 0
col = 0
while True:
worksheet = workbook.sheet_by_index(num)
if worksheet.cell(row, col).value != xlrd.empty_cell.value:
worksheet.cell(row, col).value
row+=1
else:
if num != 12:
num = num + 1
row = 9
I am getting the below error:
File "", line 4, in if worksheet.cell(row, col).value != xlrd.empty_cell.value: File "C:\Python27\lib\site-packages\xlrd\sheet.py", line 412, in cell self._cell_types[rowx][colx], IndexError: list index out of range
Help me!!!