Open Aitor13 opened 2 years ago
I also have a similar problem now. Did you happen to edit the file with openpyxl
before?
Hey everyone, sorry for the delay on addressing this its finals week. This should be resolved next week. Thank you for your patience
I also have a similar problem now. Did you happen to edit the file with
openpyxl
before?
Yes, with openpyxl no problem
Hey everyone, sorry for the delay on addressing this its finals week. This should be resolved next week. Thank you for your patience
Thank you!
Is there a way for us to help btw?
Is there a way for us to help btw?
yes, of course! If you guys figure out the bug and send in a merge request, those are usually easier and faster for me to incorporate
@Aitor13 I was not able to replicate the error. I altered an existing excel file with openpyxl as it appears that is what you have done and added a named range since the trace appears to stop there but the file was able to be read back in to pylightxl. Can you send a simple excel file where this error exists?
I added a formula that is only available for microsoft excel 365 to encounter that problem btw, formulas like this:
worksheet['C5'].value = '=UNIQUE(B5#)'
which gives me the following error if opened with pylightxl:
Traceback (most recent call last):
File "/Users/aa/Documents/excel_debug.py", line 13, in main
db = xl.readxl(f)
File "/Users/aa/venv/lib/python3.8/site-packages/pylightxl/pylightxl.py", line 119, in readxl
wb_rels = readxl_get_workbook(fn)
File "/Users/aa/venv/lib/python3.8/site-packages/pylightxl/pylightxl.py", line 234, in readxl_get_workbook
sheetId = int(re.sub('[^0-9]', '', rId))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
Process finished with exit code 1
More info:
#
only available in excel 365 and openpyxl
works with excel 2010Maybe the error is then out of the scope of this library?
@steven-tjong hey i took a deeper look at the new office 365 "spill array" which is what the #
is in reference to and without getting 365 myself i wouldnt be able to dig further into it. i am not sure what the structure of the xml is for such reference. However we can see if i can dig into it if you send a office 365 file with a simple unique(B5#)
used in it.
Really sorry for the late reply, I am also somehow unable to have it working on two of my laptops anymore...
@steven-tjong right, thank you for posting. Yes currently pylightxl does not support the new office 365 features such as the one you showed in the figure (spill arrays). I will keep this issue open until pylightxl addressed the new 365 features, but for the mean time i will add a disclaimer/limitation to pylightxl that it does not support new 365 features like spill arrays.
Pylightxl Version: 1.58 Python Version: 3.9.2
Summary of Bug/Feature: I can not pass the path of file to read with "xl.readxl(path)"
Traceback: TypeError Traceback (most recent call last)