[Advanced Excel] Issue opening excel
excel-png
Web icon
Forge component by Carlos Freitas

I am getting an error "Unable to cast object of type 'OfficeOpenXml.ExcelWorksheet' to type 'OfficeOpenXml.ExcelPackage'." when trying to open an excel file to read data.

I am using 

Workbook_Open_BinaryData

to open the file.

Hi @BeingPandey ,

That error usually indicates that the action was expecting a Worksheet object and received a Workbook object. 

Can you share with us your logic and the inputs of the Workbook_Open_BinaryData?

Hi Pedro Marques,

I am calling the following function in the given order.


Workbook_Open_BinaryData (To open the excel)

Worksheet_SelectByIndex (To select a sheet )

Cell_ReadByIndex ( to fetch value of a cell from the selected sheet)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.