Write Range: The given key was not present in the dictionary

Hi every one.

Help me please.
I use write range for inputting data from datatable to excel, but there is a problem. I’m not sure what the cause is.

This’s error :
Write Range: The given key was not present in the dictionary.
RemoteException wrapping System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at UiPath.Excel.Activities.WorkbookActivity1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) RemoteException wrapping System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at UiPath.Excel.Activities.WorkbookActivity1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
RemoteException wrapping System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at UiPath.Excel.Activities.WorkbookActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Hi @RB-TTT,

Can you let me know the type of the value your passing for the field “Datatable” in write range activity?
If possible can you share the workflow

Thanks,
Teena

1 Like

Hi @RB-TTT

Can you show us some screen shot of your workflow?

What is the version of Uipath studio and package?

Regards
Gokul

1 Like

Thanks for responding to my question. @Teena @Gokul001

Sorry, I don’t know how to paste image please click link for look .
https://www.picz.in.th/image/a2o4xg

and Version
https://www.picz.in.th/image/a2OQ5a

My system can run 1 time after write range in excel will be error.

I would like loop this working.

HI @RB-TTT

Can you share the File_Combine → path with us?

If possible share the XAML file here

1 Like

Does the error appers only for write range activity or other some activity also apear same error?

There is two case:

  1. It happens due to wrong variable supply to the activities
  2. Some license issues. Need to reinstall Uipath if it occurs for all activities.
    Check this thread
    All programs getting "The given key was not present in the dictionary." - #3 by Srini84
1 Like

Have you tried with Excel application scope activity instead of Workbook activity @RB-TTT

image

Regards
Gokul

2 Likes

I see something. my file is a type .xlsm.
when I try again create new file is type .xlsx it can work

But I would like to do in type .xlsm
Please help me or recommend how to.

and please how to share XAML file.

@RB-TTT
Use Excel application scope and thier activities, you can read the .xlsm files

1 Like

Hii @RB-TTT

Have you have used Config File here?

1 Like

Thank you for recommend. I will try and I will update for you.

Hi @Gokul_Jayakumar

I can do it.
I used Write Datatable to Excel in Excel Process Scope.

Thank you @Gokul_Jayakumar so much and Thank you every one.

Have a good day every one.

@RB-TTT ,
Pleasure is mine,
Kindly mark the solution. It will really helps for someone who looking for same issues.

Happy Automation

Regards,
Gokul Jai

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.