Write Range Error "The given Key..."

Hey Guys,

does anybody know the problem “The given Key was not present in the dictionary” with the stand-alone “Write Range” Activity?
Error_Dict_1

I just use the read range inside an Excel application scope and try to write the output (data table) into another Excel Workbook with the stand-alone write range activity. Then I get that Dictionary error but I don`t use it in my workflow, I just want to write the data table.
Error_Dict

The funny thing is, if I use the write range acticity from the Excel application scope I don`t get the error.

I would like to use that one because I dont want to open Excel in the foreground if I dont have to.

Is it a bug of the stand-alone activity?

Thanks,
Achim

hi @Akimbow,

Can you Verify the Properties of the Write Range - There you are not using ant dictionary on timeouts. Also, One More thing you can try Here … Copy paste this code in a new Xaml File and then Run .

Please check the arguments pane also


Mukesh

Have a look on the visible parameter as well:

Visible - When selected, the Excel file is opened in the foreground while performing actions on it. When it is cleared, all operations are done in the background.

1 Like

Thanks for your help but I think it is a bug of the activity because the same activity for excel application scope works fine. Mmmh…

1 Like

@Akimbow,

Have you got any solution for this issue. lately I’m also trying to resolve this issue. I did everything but I think it’s a Bug. @Pablito, @loginerror, @Syed_Pasha is there any solution for this issue

Hey @SamanGuruge

Could you let us know which version of the Excel activity package are you using?
I tested this scenario on this one and it works just fine:

Alternatively, if you could reproduce the issue on a fresh new project with dummy Excel files and send it in this topic, it would help us quickly address the bug (if it still exists in the latest activity package version)

Hi @loginerror,

image

Actually its working for normal scenarios. but when I parse SheetName and Filepath from argument it giving above error

image

SheetName = in Argument type - Dictionary <String,String> Value = “5. combined ABC100_ABC100 LF”
Filepath = “Data\Output\something\11.18.2020\Something ABC_100_11.18.2020.xlsx”’
DataTable = comes from SQL query result

when I’m running using above input it will fail and if I used excel activity it works but for workbook activity it fails

I am having trouble reproducing it on the latest Studio 20.10 and the same activity package as you are using.

Are you should that your dictionary is correctly set when you are using the arguments? (this is only a slight suggestion, I assume it is due to the fact it exactly the same for Excel Application Scope).

I would really appreciate a full project that reproduces the issue. It doesn’t have to be your specific project, but could be a newly created one with minimum amount of activities that will reproduce the issue.

Hi @loginerror,

Thank you for the support, ya i’m using exact same argument for the Excel activities then it works fine but for the Workbook activity it wont work,

I’ll replicate code into new project and send you ASAP

If I walkthrough the bigger picture it like I have a template and I coped into a directory to produce my final result and the all output path names are pass into the immediate next flow and in that flow SQL query result will be entered into a one sheet using Workbook > write range activity the issue is if I Hardcode all the values and run the process if gives me the above error even I haven’t used any Dictionary

1 Like

I could Repro with the following setting:
When the write range is used into an existing XLSX where in the header a column has either a NOTE or a COMMENT, then this error is thrown.
@Pablito posted in internal activities channel with repro workflow

2 Likes

Hello,

As mentioned above, the issue is caused by the presence of a Comment in the sheet. This same issue is reported here [DATA LOSS] Write Cell can cause data loss (it writes over the entire worksheet in random cells if a comment is present in the xlsx file).

I was facing same issue, before I realized I had not checked in image

Any news on this bug? The original report was in 2018.

1 Like

the same activity for excel application scope works fine as they said before. Thats the way I solved it.
But issue keeps appearing in the standalone activity.

The year is February 2022. I lost 3 hours before I realized that the fault was in the note in the cell !!! Why has it not been further fixed? What a crap

5 Likes

Same issue here! I have to use the workbook activities instead of Excel Scope. Any workarounds?

and this issue still occur on version 2.11.4

The issue still occurs. I think this bug is not yet solved by the UiPath team.

1 Like

This error continues happening :frowning: