Read-only workbook is not serializable
A workbook being loaded with read_only=True cannot be serialized by pickler (pickle.dump()). This breaks the parallel processing of the books data.
book = openpyxl.load_workbook('filename.xlsx', read_only=True, data_only=True) with open('dump.bin', 'wb') as f: pickle.dump(book, f)
Results with the exception:
TypeError: cannot pickle '_io.BufferedReader' object
The 'regular' book (without read_only flag) works fine.