Support > Forums > OpenBots Studio > Excel Get Range & Excel Get Last Row

Excel Get Range & Excel Get Last Row

Dustin Krick

  • Reporter
  • Calender Icon February 28,2023 at 5:18 PM

I'm trying to get the last row of an excel sheet.

In the Excel Get Last Row Index, I'm using a variable type of Int32 named vLastRow.

When I try and call that vLastRow in the Excel Get Range using "A1:E{vLastRow}", every time I receive the error message:

Message: 'Cannot convert type 'string' to 'object[,]'']

If I manually enter a number for E, this works fine. Say - "A1:E255" this works fine, but I want to dynamically set this.

I'm not sure what I'm doing wrong here.

Any advice out there on this?

This forum has 314 topics, 681 replies, and was last updated 21 days ago by Support Agent

Dustin Krick

  • Participant
  • Calender Icon March 02,2023 at 1:38 PM

That worked, thank you!

Rushabh Arbat

  • Participant
  • Calender Icon March 01,2023 at 3:00 PM

Hi Dustin Krick,

Thank you for sharing your query.

Actually, the error occurred because of you entered a variable inside the string basically it's syntax issue. Can you please try to use range like that "A1:E" + vLastRow
Let me know if it's work for you.

Thanks.

You are not authorized to reply, please click here to login and add your reply to this topic.