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

excel
activities

#1

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


"Range does not exist
#2

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.


#3

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


#4

Hi @Estelle,

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


Fastest way to write an excel formula into an entire column
Insert excel formulas from Datatable into Excel as formulas and not as strings
#5

Ok will do.


#6

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

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.


#8

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.


#9

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.

#10

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”.


Execute macro fails when another excel file is open
#11

Thank you for your answer, that was my error.


#12

It worked out for me as well.
Thanks!


#13

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


#14

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