[Excel Package] Unable to cast object

Forge Component
(5)
Published on 2018-08-02 by Carlos Alfaro
5 votes
Published on 2018-08-02 by Carlos Alfaro
Hi,
I am having trouble with the write_range. When trying to add a List as an object, I get an error message:

I'm having the same problem...
Same issue here. Any chance anyone has already migrated this extension to the new (record)list types?
New version with the correction. Version from 31 of March.

This is the error I got. "Unable to cast object of type 'OfficeOpenXml.ExcelPackage' to type 'OfficeOpenXml.ExcelWorksheet'."

Raymond Reyes wrote:

This is the error I got. "Unable to cast object of type 'OfficeOpenXml.ExcelPackage' to type 'OfficeOpenXml.ExcelWorksheet'."

I was having this error as well, but i spotted a mistake of mine.The cell writeRange asks for a worksheet object and not a workbook object. Because they are both objects, the platform suggests both of them.

You need to get the worksheet first (either by index or name) and use it there. Dont forget to cast you Record list into object.