Open Excel from Variable


#1

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
    com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing OpenSpreadsheetAction[id=16,name=Optional[OpenSpreadsheetAction],parent=14,nextSibling=18,children=[17],arguments=ActionArguments[delay=[0],filePath=[${element}],xsi:type=[recorder:OpenSpreadsheetAction, recorder:OpenSpreadsheetAction],pollingInterval=[300],active=[true],actionDetails=[("${element}")],awaitTimeout=[5000]]]
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.tryExecuteScript(OpenSpreadsheetAction.java:109)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:71)
at com.workfusion.studio.rpa.recorder.playback.action.OpenSpreadsheetAction.execute(OpenSpreadsheetAction.java:16)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:53)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:153)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:113)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.WebDriverException: java.lang.ClassNotFoundException: org.apache.poi.poifs.filesystem.NotOLE2FileException cannot be found by com.workfusion.studio.dependencies.rpa-api_9.0.0.3
Build info: version: '9.0.0.3', revision: '1610cb545e', time: '2018-05-24T16:45:36.185Z'
System info: host: 'RPA-COMPRAS-000', ip: '192.168.45.165', os.name: 'Windows NT (unknown)', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'

#2

Hi Adolfo,

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

You are using RPA Express 1.4.0, correct?


#3

Does your ${element} contain the correct path and filename to the Excel file when you check in the execution results log? (https://kb.workfusion.com/display/RPAe/Recorder+Variables#RecorderVariables-RecorderVariablesLogVariablesLog)


#4

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

I’m using this version:
image


#5

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


#6

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


#7

Here are the logs:

logs.zip (41.2 KB)


#8

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


#9

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?


#10

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


#11

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.


#12

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.


#13

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


#14

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 .


#15

Can you share your recording here to have a look?


#16

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


#17

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


#18

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)


#19

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 - excel-file.zip (754 Bytes)


#20

thnx @ashapkina it’s working