Open Excel from Variable

Today, I tried to open an Excel from a variable received from the “Get folder contents”

but got this error, please help

Error executing OpenSpreadsheetAction

Caused by: org.openqa.selenium.WebDriverException: java.lang.ClassNotFoundException: org.apache.poi.poifs.filesystem.NotOLE2FileException cannot be found by

Hi Adolfo,

What is the file path stores in ${element}? Could you share please.

You are using RPA Express 1.4.0, correct?

1 Like

Does your ${element} contain the correct path and filename to the Excel file when you check in the execution results log? (


Hi Alesia,
The path is: C:\robot\entrada\PMT_PROVEEDORES_SAP_CAM_2018-06-13.xls

I’m using this version:

Hi Tim,
Yes it is… but looks like that the error is due to missing dependencies.

It is not clear what exactly caused the error. Could you zip and send us these logs: C:\RPAExpress\RPA\logs ?

Here are the logs: (41.2 KB)

Thank you @adolfo_riosSLu, we’ll study the logs and get back.

1 Like

Hi @adolfo_riosSLu,
According to the log, the file type is wrong:

Exception: Failed to execute script. Invalid header signature; read 0x6D78206C6D74683C, expected 0xE11AB1A1E011CFD0 - Your file appears not to be a valid OLE2 document

Does the file open correctly when you open it manually?

That’s the problem!
Wow, thanks for your help.

Alesia, trying with another file, looks like it is the same problem, but when I try to open it manually, show me this:

When I click on yes, I can open the Excel.

Try opening the file and saving it as a .xlsx file and then using it in the recording. Please let me know if it helps.

Thanks Alesia!
I’ll will try to do it with the RPA Studio, opening the .xls and then save it on another .xlsx file, then automate the iteration with the excel actions

1 Like

hey. I have a query. Actually after opening multiple excel from variable, I want to switch to multiple sheets to copy paste the data. but it retrieves only last excel from variable .

Can you share your recording here to have a look?

thnx @ashapkina that problem is solved please tell me how to paste an excel data to another excel last entry

@ddivya can you provide more details? Do you just need to paste data from one excel file to another one?

i have two excel sheets namely 6 and 7 . i want to paste excel 7 data to excel 6 below the excel 7 data 7.xlsx (9.3 KB)
6.xlsx (9.4 KB)

Try using this solution:

  • get range from excel 7 to table7
  • get range from excel 6 to table6
  • calculate the number of rows in table6 and save in a Number variable rows
  • add 1 to the number variable
  • set range (table7) to excel 6. Start cell - A${rows}

Here is a sample script - (754 Bytes)

thnx @ashapkina it’s working

1 Like