For Each: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Hello,

we are getting this error for for each.
we have 4 admin account and named user licenses and we are running automations from all 4 accounts.
for one of the script only we are geeting rcp server error multiple times randomly for sometimes read range ,write cell activities from other 3 accout sbut from 1 admin account it is running everything properly only when it goes for next sheet there only it gives error.
we have total 4 sheets to work on.
like below we are getting error

what should i chnage to resolve this?

@Mathkar_kunal

This error usually comes from Excel getting stuck in the background, not from the For Each activity.

Please try below points:

  • Close the Excel file before running the bot.
  • Kill all background Excel processes before the bot starts.
  • Do not run the same Excel file from multiple accounts at the same time.
  • Keep all Excel activities inside one Use Excel File / Excel Application Scope.
  • Add a small delay before moving to the next sheet.
  • If the file is on a shared/network path, copy it to local folder first, process it, then move it back.
  • Check Excel add-ins and permissions for the account where it is failing.

Since it works with one admin account, it may be related to that user profile, Excel session, or file access issue.

Hi @Mathkar_kunal

Can you share what the Body of the For Each contains?

If using an Excel Process Scope then try messing with these properties:

Regards
Soren

tried but got same error