How to fix/solve Read Range Error (Excel Scope)

Hi Experts,

I am facing issue in Read Range Activity, this activity works fine one time and then gives error, please see the snapshot below: ReadRangeError

The Scenario is as below:

  1. The CSV is being downloaded
  2. Save as Excel (different location, new file name), using gettext is store the data (sheet name to be used further for read range)
    Here i am using 2 different XML (Sequences) as Saving File and Excel Data (Separate)
  3. Using Excel Scope, get data and create new file and then change the text to column (Due to some error in converting the text to column)

At step 3 i get read range error, snapshot is attached…

Thanks,
MAK.

1 Like

Try looking at these:


Also if it’s a CSV file you can you use the Read CSV activity instead

1 Like

Hi, Thanks for your reply,

I have tried earlier “ReadCSV” Activity, but it was giving error as the CSV file format is invalid, so i have found a workaround as saving it to excel and then converting the text to column.

1 Like

Do you know what the format issue is? You could fix it potentially by first using “read text file” and then manipulating that string to correct the format and then using “write text file” before finally using “read csv”.

But anyway i’d still suggest looking through the above threads, one topic suggests using a delay after excel has opened but before the read activity. If you google the error code i’m sure there will be plenty of other suggestions.

1 Like

@Ashik_Khan,

I guess i know this issue. If i am not wrong you are using this activity in loop (where your excel gets open & appear on screen) and first iteration is working perfectly fine but the moment it goes for second iteration is causing the issue. Correct?

This above is the case , then simple resolution is to close the excel after first iteration is completed.

Hope it helps…

Regards,
Ahtesham

1 Like

Simple buddy
use a kill process activity before to this Read Range activity and mention the property PROCESS NAME as “EXCEL” that would close the excel before you read it.
And this error occurs because the file from where we are fetching is running in background
so thats why and to rectify this we need to close the application before we read

Hope this would help you
Kindly try this and let know for any queries or clarification

Cheers @Ashik_Khan

1 Like

Yes, you are right, but i did not understand “then simple resolution is to close the excel after first iteration is completed.”

1 Like

Thanks for your reply,
here is what i have understood…

Excel Application Scope Activity --> opens the file
Inside this activity under “Do” i have added “Read Range”, So before “Read Range” i should add “Close Application Activity/Process”

Do you mean this?

Please advise…

MAK.

1 Like

@md.ahtesham @Palaniyappan
I have another issue of (Microsoft Excel Product Activation) which i handle through “Attached Window and Click” .
So until the above production activation error window doesn’t get closed the close application process will not work, right?

Thanks,
MAK.

1 Like

@Ellboy
I have tried delay activity too and same result, no luck… but as you have suggested for the links. i will try that.

Thanks.
MAK.

1 Like

@Palaniyappan
I have tried as you have advised it gives me same error…
ExcelData.xaml (10.9 KB)
I have attached the XML file where i have added kill process…
and the base file is this, where i am getting the text (File Name)
SaveAsFile.xaml (26.0 KB)

1 Like

@Ellboy
@Palaniyappan
@md.ahtesham
Hi experts… any luck…i have attached the XML files for you to have a quick look, if something is wrong and need to fix…

Thanks.

1 Like

@Ashik_Khan,

I saw your both .xaml file, i have corrected your ExcelData.xaml . i don’t think you really require all those steps ,and even kill process i not required.

FYI kill process activity is used like below pic:


There is no need for all those steps i.e foreach and bla bla … I would recommend never to use kill process with Excel file .

One annotation i have added on SaveAsFile.xaml file (just before invoke workflow activity) ,please follow that to fix your issue.
ExcelData.xaml (8.3 KB)
SaveAsFile.xaml (26.9 KB)

Please revert if you face any further issues.

Regards,
Ahtesham

1 Like

Thanks…i removed kill process and it worked…

2 Likes

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