Search code examples
pythonexcelxlrdopenpyxl

openpyxl _external_links too slow


I need to read a excel and get the external_books the excel used(for there is INDEX or VLOOKUP func used in the excel)

I choose openpyxl,the openpyxl.WorkBook._external_links api can do it well,but the speed is too slow(my excel is 600KB),about 27s

here is my code:

wb=openpyxl.load_workbook(os.path.join(self.parent_path, name), use_iterators=False, data_only=True)
external_links = wb._external_links

Is there a way too speed up?

or other python excel lib to use?(I searched apis in xlrd,but found no same api to get the external_books)


Solution

  • Try "read_only=True" option it should reduce time.