I’m encountering an issue with KNIME openpyxl module. I’m attempting to load an excel workbook that is saved in the same folder as my project (and not corrupted).
However, I receive the below error message whenever I try it. This is strange because there’s nothing unusual about the workbook and the code works fine when in a standard Python environment. Is there any reason why this would cause be causing problems in KNIME?
ValueError: Unable to read workbook: could not read worksheets from file manipulation.xlsx.
This is most probably because the workbook source files contain some invalid XML.
Please see the exception for more details.
Traceback (most recent call last):
File “”, line 3847, in
File “”, line 27, in run_code
File “”, line 3843, in return_excel_template
File “”, line 92, in open_openpyxl_file
File “C:\Users\Public\KNIME\bundling\envs\org_knime_pythonscripting\Lib\site-packages\openpyxl\reader\excel.py”, line 346, in load_workbook
reader.read()
File “C:\Users\Public\KNIME\bundling\envs\org_knime_pythonscripting\Lib\site-packages\openpyxl\reader\excel.py”, line 307, in read
raise ValueError(
Hi,
Just to add a bit of info - I tried this with an empty workbook with no formatting and it gave the same error so must be something other than the contents of the file.
Thanks.
Hi @mlauber71,
Unfortunately this didn’t work, it still gave the same error message. When I put a random file name that doesn’t exist it gives a different error message so it must be able to see the file.
Thanks,
Thomas
Hi, just to update - I’ve been testing things out and it looks like openpyxl within KNIME isn’t liking my file. My code is converting a binary file to excel, saving it then reimporting using the extract of code provided above.
The odd thing is I don’t get the error outside of a KNIME Python environment, are there any XML/ formatting restrictions within KNIME’s openpyxl library that could be causing this?
Thanks
@TPattison I do not think knime is using any other library. Maybe you can provide a sample file and workflow that demonstrates the problem. Without spelling any secrets obviously.
Have you tried running any of the examples I provided?