openpyxl.reader.excel module

openpyxl.reader.excel.load_workbook(filename, read_only=False, keep_vba=False, data_only=False, guess_types=False, keep_links=True)[source]

Open the given filename and return the workbook

  • filename (string or a file-like object open in binary mode c.f., zipfile.ZipFile) – the path to open or a file-like object
  • read_only (bool) – optimised for reading, content cannot be edited
  • keep_vba (bool) – preseve vba content (this does NOT mean you can use it)
  • guess_types (bool) – guess cell content type and do not read it from the file
  • data_only (bool) – controls whether cells with formulae have either the formula (default) or the value stored the last time Excel read the sheet
  • keep_links (bool) – whether links to external workbooks should be preserved. The default is True
Return type:



When using lazy load, all worksheets will be openpyxl.worksheet.iter_worksheet.IterableWorksheet and the returned workbook will be read-only.