2

I use this library openpyxl.

And read data as:

for row in sheet.rows:
    print row[0].value

Instead value of cell I get formula: =D42-D42*0.1.

Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
POV
  • 11,293
  • 34
  • 107
  • 201

1 Answers1

11

Edit: In latest version (3.0.6+) the api was changed to disable the user of the first option (internal_value property) and thus only the second option now works. (Thanks Akshat)

You can either

  1. Use row[0].internal_value.

Or

  1. Use data_only=True when you load your workbook. (For example, workbook = openpyxl.load_workbook("yourxlsx.xlsx", data_only=True))

The second option is good when you are sure you don't wish to ever get the original formula from the workbook.

Tals
  • 468
  • 4
  • 17