How to read excel spreadsheet to a List or Table variable

Based on multiple user requests, we created 2 examples covering the excel spreadsheet iteration (row by row or cell by cell).

Currently, when you use the Get Cell Value (Cell below) or Get Row (Next) in a While loop, the active cell stays the same and does not jump to next cell/row in each iteration.

This is because the Get action does not make the target cell active. To overcome this inconvenience, you need to use an additional Set Cell Value (Cell below) or Delete Cell (Cell below) actions.

Below you can find two examples showing how to iterate trough Excel file:

excel_examples.zip (19.4 KB)

Example 1 - reading excel column to a List variable

Example 2 - reading excel spreadsheet to a Table variable

In the 1.1.4 release, we will introduce 2 new actions that will allow to do this more efficiently:

  • Set Active Cell
  • Get Range

@azinchuk
Hi Sasha,
Thanks for the solution.
Have a concerned about this, if user want to change the Excel and by mistake He/She changed the cell position of the Excel(Tickers.xlsx) rather than1st Cell(A1) and saved it.
then this action flow will not work, for that it will be an Pre-condition that upon opening an Excel user first need to switch to the first(A1) cell , save the file and then proceed.

1 Like

@jain_rohit_ghrc,

You are right - the safest way is to set the A1 cell active. In the next release the Set Active Cell action will solve this problem.

Besides your solution there is another workaround:

  1. Get Cell Value (Start of Document) to variable ‘temp’
  2. Set Cell Value (Start of Document) from variable ‘temp’
  3. …your excel actions
4 Likes

In 1.1.4 RPA Express has these new actions:
https://kb.workfusion.com/display/RPAe/Excel#Excel-GetRange
https://kb.workfusion.com/display/RPAe/Excel#Excel-SetActiveCell

How I can retrieve the content from Excel sheet and put its an content of mail and need to send mail.? Please explain

How I can retrieve the content from Excel sheet

Please see the examples above how to do this

put its an content of mail and need to send mail

You can open your email client and start typing each Table item using a For Each loop.

the sample code provided in the forum is not working when I attempt to download the same and execute , kindly provide help in order to read the entire sheet using rpa express and update specific columns based on actions

the 1.1.5 version has issues with Loops inside the Excel action, which will be fixed

1 Like

Could you please notify here when this issue is fixed. Also, would downloading an update from the window->preferences menu suffice when it is fixed?
Thank you.

It is planned for the next week. To update, you need to download the whole RPAx installer again.

1 Like

Can you provide the 1.1.4 version that supports this action?

@psidhu,

can you please wait till Monday to get the 1.1.6 version?

Sure. I can. Thank you.

Hi!!
I’m attempting to read a column set one by one, so I can use the retrieved cell data to be put as string and use it to fill in in another window. I couldn’t make it yet… I cannot add a window action to this While…

Why do you need the Window action while using the Excel actions?

I was expecting to do something like this:
“While 1=<to #cells used for a specific column” then activate window… and so on for another application.

It is better to read a column into a list variable, and then iterate through this list

Hi,
I was attempting to use a while to open file and even though the condition is met, the program stops the run:


image
Please advise.
Thanks!