Issue When Writing to Excel Sheet using Write To Excel Component

Hi Team,

I am facing issues while writing to excel sheet.
In my automation we have an excel sheet which will be having many rows and we process each row data and after processing we will be updating status post processing a row in excel. I am seeing issue “You Can’t Perform This Action When The File Is Read Only” error message can i get help how i can fix this issue

Hi @nagasai

Please open Task Manager and close all the instances of Excel from the details tab.
Then try to run the process and update whether your automation is still failing.

Hi,

If you are using multiple Write to Excel then try putting some delay of at least 1 sec between the two Write To Excel blocks.

Regards,
Amit

Hi @amit_anand15 I have added a delay between 2 process of 2 sec and that’s not helping me

@Mantri Do i need to kill the session every time before i write to excel file ? Initially before start of my process i am killing all excel sessions post that my automation will read data from excel file and processing 1 records/row every time it updates status back to sheet.

Hi,

Are you running 2 process with same excel

Regards,
Amit

Hi Amit,

Yes same excel file which is used to ready each data to process and updatte in same excel file of processing status.
It used to work some times and most of the times it used to through this error.

Hi,

There is no need to create two separate process.

In 1 process only inside Excel loop , use Write to Excel activity

Regards,
Amit

Yes, its only 1 process. Below is the flow
Download file from a website which is .xlsx file loop through the file and process each record post processing updating back status of that row to processed.
We are seeing issue when updaing back status to processed.

This used to work some times and some times its geting failed with error menioned.

Hi,

You can debug process by keeping only1 Write to excel activity and see if this error occurs.

Then put another Write to excel and place a Dely block say 15 sec and see if the error occurs.

Let me know the outcome

Regards,
Amit

Thanks Amit, I figured out another wau to achieve that
I have assigned a variable and appended status of respective row processing and after completion of loop i have wrote a python pandas script and inserted this array data in pandas dataframe column and wrote to excel file.

1 Like