How to find excel coordinates?

Hi,

While using excel operations how to get the cell coordinates of a particular cell based on the text in the cell? Kindly help to resolve this issue. Thanks in advance.

You cannot do it in Excel actions, but if you open the Excel file on the screen, you can get the coordinates using a custom action.

The coordinates of an Excel cell are kept in attribute “Name”.

@CustomScriptAction(
input = ['text'],
output = 'name'
)

def customScript() {

name = RString.of($("[CLASS:DataItem; TEXT:${text}]").getAttribute('Name'))

}

Here is a sample recording
excel-get-attribute.zip (6.8 KB)

I hope it helps!

Thank you so much for the help and it worked absolutely good!! Thank you.

1 Like

Hi,

The above solution works good for a single process… Can u please assist me how to work the above process in a loop where i open excel sheets from a for Each loop and get the cell coordinates of each excel and perform the actions.Since the launch application can’t be inserted in the for each loop. Kindly help…

You can insert the Launch application action in the For Each loop.

Hi,

While using the above action i’m not able to open the excel as an error occurred stating unable to find the path to excel but when i copy the path and open it manually i can open the excel… help me find out where i went wrong…

Hi @Arthi can you share your recording or a screenshot of the action that opens the excel file?

@ashapkina
Please find the snapshot of the sequence. I use Launch application to open excel with excel path and filename and error occurs unable to find the path to excel but i can open the file from win-R action (from clipboard filename)

@Arthi what is the path to the Excel file you are trying to open?

The path to excel is from the variable “filename” and excelpath is the location of excel from c drive.

Yes, I understand it. Can you share the value that is stored in variable “filename”?

Yes the value stored i n filename is D:\RPAFiles\TempShare\ec\R-0723368\RPATemp\mx1547797025590\DCR\R-0723368_DCR 09Jul2018.xlsx

It happens because of the space in the filename. Launch Application cannot open such files now.

As a workaround, you can use another name for the file, or use Win+R to open it.