It was throwing an error because was failing to write a list to an excel cell, now it's explicitly converting the value to string.

Python: Traceback (most recent call last):
  File "\blenderbim\bim\module\fm\operator.py", line 102, in execute
    writer.write_xlsx(filepath)
  File "\blenderbim\libs\site\packages\ifcfm\__init__.py", line 259, in write_xlsx
    cell = worksheet.cell(row=r, column=c, value=col)
  File "\blenderbim\libs\site\packages\openpyxl\worksheet\worksheet.py", line 247, in cell
    cell.value = value
  File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 218, in value
    self._bind_value(value)
  File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 187, in _bind_value
    raise ValueError("Cannot convert {0!r} to Excel".format(value))
ValueError: Cannot convert ['USE TYPE CATALOG'] to Excel
This commit is contained in:
Andrej730
2023-10-18 16:40:07 +05:00
parent 627cf63a4c
commit c85826ef2e
+1 -1
View File
@@ -256,7 +256,7 @@ class Writer:
cell_format = "n"
else:
cell_format = colours[c - 1] # Adjusted the indexing
cell = worksheet.cell(row=r, column=c, value=col)
cell = worksheet.cell(row=r, column=c, value=str(col))
cell.fill = cell_formats[cell_format]
c += 1
r += 1