Cannot get formula of the cell in read-only mode

Issue #924 wontfix
Quang Hai Luong
created an issue

When I try reading the spreadsheet file in read-only mode, many formulas cannot be read. I only get the '=' returned when calling cell.value. The following is my source code

wb = load_workbook(f_path, read_only=True)

    for sheet_name in wb.get_sheet_names():
        ws = wb.get_sheet_by_name(sheet_name)

        for row in ws.rows:
            for cell in row:

                if cell.data_type == Cell.TYPE_FORMULA:
                    print('Formula: ', cell.value)

    wb.close()

Comments (4)

  1. CharlieC

    The problem is related to the use of shared formulae in the worksheet. In standard mode these are mapped and recalculated but this isn't really possible in read-only mode.

  2. Log in to comment