Question

Problem with using WorksheetGetUsedRange method from microsoftExcel

Hi,
I am in the middle of exporting the data of an Excel(.xls) to a data table using microsoftExcel .
To get the used range of the sheet I used the method WorksheetGetUsedRange. surprisingly I am unable to pass data to the workbook property. Even tried to hardcode it but still its not allowing me.

Also observed for .xls files, Excel connector is not working.

Correct Answer
September 20, 2019 - 10:30am

The method takes the _Workbook type. Try passing "ExcelWorkbook" property instead of the Workbook. 

Comments

Keep up to date on this post and subscribe to comments

September 20, 2019 - 10:30am

The method takes the _Workbook type. Try passing "ExcelWorkbook" property instead of the Workbook. 

September 20, 2019 - 11:25am

Thanks. That works!!
Want to know difference between them.
By the way will Excel connector works with .xls files ??

September 20, 2019 - 11:56am
Response to chakri5122

Go ahead take time to review the Help Guide page for the connector: http://help.openspan.com/80/Components/Microsoft_Excel.htm

The help guide is a great resource for understanding the inner workings of Robotics. 

In short: ExcelWorkbook is the connecting reference to the actual Excel workbook object. Workbook is the file path to the Excel Workbook. The methods have no use for this. 

I don't have much experience with .xls files, but a quick test on my end shows Pega was able to open it. version: SP1 2003