openpyxl unable to open the xlsx

Issue #841 resolved
created an issue

hello all,

i just encountered problem with open the excel with openpyxl on the line " load_workbook()"

the openpyxl version is the latest "openpyxl 2.5.0a1"

it seems the ceel with the style [red], would cause the problem.

here is the error msg:

Traceback (most recent call last):
File "E:\Development\python\src\", line 184, in <module>
File "E:\Development\python\src\", line 57, in read_excel
inwb = load_workbook(inpath,read_only=False,data_only=True)
File "C:\Python27\lib\site-packages\openpyxl-2.5.0a1-py2.7.egg\openpyxl\reader\", line 247, in load_workbook
File "C:\Python27\lib\site-packages\openpyxl-2.5.0a1-py2.7.egg\openpyxl\reader\", line 127, in parse
File "C:\Python27\lib\site-packages\openpyxl-2.5.0a1-py2.7.egg\openpyxl\reader\", line 287, in parse_row
File "C:\Python27\lib\site-packages\openpyxl-2.5.0a1-py2.7.egg\openpyxl\reader\", line 223, in parse_cell
value = from_excel(value)
File "C:\Python27\lib\site-packages\openpyxl-2.5.0a1-py2.7.egg\openpyxl\utils\", line 97, in from_excel
return datetime.datetime(*parts[:3]) + diff
OverflowError: Python int too large to convert to C long

Comments (4)

  1. gclu0212 reporter

    anyone could please provide solution for the issue, im running an urgent project.
    and the openpyxl even could not open the excel , so sad. :(

  2. CharlieC

    If your project is urgent then why are you running a pre-release version of the software? If you use openpyxl 2.4.x you shouldn't have any problems.

    The problem seems to be related to the number format used for this cell which makes openpyxl think that the cell is formatted as a date and therefore try and convert it to a Python date object. This is a side-effect of a poor decision in OOXML not to use an explicit marker for datetime objects.

  3. Log in to comment