0

I am using Python 3.7 and using OpenPyxl to read the sheet names from a large excel workbook (29MB) with 10 tabs.

import openpyxl
from openpyxl import load_workbook
wb = load_workbook(filename='h:\\Master_Portfoliio.xlsx')
print(wb.sheetnames)

The code above works for smaller files but when I use the same code for this file, the code just hangs. I would like to read the sheet names and then remove a tab and then copy a tab from another excel workbook into this workbook.

eyllanesc
  • 190,383
  • 15
  • 87
  • 142

1 Answers1

0

Have you tried the read_only = True flag?

wb = load_workbook(filename='h:\\Master_Portfoliio.xlsx', read_only = True)
eatmeimadanish
  • 2,930
  • 1
  • 9
  • 14