Write range activity - Error message "Range does not exist"

Hi,

When trying to write data from a dataTable to a new excel file (want him to create the file), there is an error message “Range does not exist” while the dataTable has data inside. This was done with a ‘write range’ activity. Do you have any idea?

Thanks

Hi @Estelle,

If you want that your whole datatable is written into the excel sheet, try to let the Starting Cell property empty. Also, check if the Add headers is checked.

1.1 VA05.xaml (7.4 KB)

There are basically two ways to do it:
1.

2.

1 Like

Hi @acaciomelo ,

Thanks for your reply.

Just try what you said but have the same error message. Please see below.

Error message:

Please let me know wht you think.
Thanks

Hi @Estelle,

In this case, I suggest you to reinstall the UIPath.Excel.Activities package and then restart UIPath.

2 Likes

Ok will do.

Hi @Estelle,
I also got the same error. No idea what the issue is. But then I tried using “Write Range” under the “Workbook” tree and it worked without any error. I thought this may help someone if they face the same issue.

Thanks

7 Likes

Check your target EXCEL file is writable for your current user, I have the same issue, and I finally found that the Excel file has been writing protected except special users.

And also if the Excel file has some head row fixed or hidden columns, it will affect the write range to it.

Hello,

I had the same error, actually i had genericValue data in my dataTable. Use .ToString for each Data which is not a string value.

5 Likes

Hi Estelle,

Suggest the comments provided by @Shinyo_Katsu_JP_Cons , I use to experience this problem even its not write protected.

  • Use new excel file, if you are using template to write the content just recreate the template.
  • Close excel instance if any running in task manager and try again.

Hi

I have been having the same error, but it went away when i removed the sheet protection of the file (and unshared it).
I hope you can use my picture below despite Microsofts annoying translation:
image
The first (and the one looking most like at retangular square) is “Protect sheet” and the one that looks like its been drawn by a drunk elephant is the “Share project folder”.

2 Likes

Thank you for your answer, that was my error.

1 Like

It worked out for me as well.
Thanks!

If you still want to keep the Excel file protected you can write two macros in VBA to unprotect at the start of the automation and unprotect at the end. You can use the execute macro activity for this

I’m still getting this error, the file is not protected. Has anyone figured this out?

When you get this error Range does not exist, Try Write Range from Workbook, It will work.

Thanks,
Raju

Hi Guys, I got the same issue, but what I did was I used the Write Range from System → File → Workbook, not from App integration → Excel. Which means UiPath Studio got the two Write Range Activities with duplicated name. IF you select the correct one, will fix your error message!!! Go luck all!

1 Like

can you please attach the workflow?

Has anyone found a solution for this?

I have tried reinstalling the Excel activity package and also converted the column datatype to String. However i am still facing the “Range does not exist” error.

Unfortunately my requirement is such that I cannot use the Workbook’s Write Range
I am using UiPath Studio 2018.4.4, but the same action works in an older version of studio.

Hi @pearlb

Welcome back!

Does it mean that the workaround to use the workbook Write Range activity works?
It would help in debugging the issue.

Could you use the Output Data Table activity, save it to a txt file and check for any irregularities?

If you could, please also share a dummy project with dummy data that causes this issue. It would help a ton to be able to reproduce it easily :slight_smile:

1 Like

Hello…

The same datatable is written into an excel if used with the Workbook’s write range activity, so I would assume that the datatable should be alright.