Excel Process Scopeを再利用できません

こんにちは
UiPath Studio 2025.0.172STS Community editionのユーザーです。

1.やりたいこと

ExcelProcessScope配下で下記を順次実行したい。
(1)"Config\config.xlsx"の"Sheet2"を開く。
(2)"Config\config.xlsx"の"Sheet1"を開く。
(3)"Setting\Setting.xlsx"の"Sheet1"を開く。

2.悩んでいること

デバッグすると、下記でエラーが発生しました。
Excel ファイルを使用: RPC サーバーを利用できません。 (0x800706BA)
Improved Plan:を採用すればエラーは解消されると推測しますが、
プロジェクト設定で、「Excel Process Scopeを再利用する」設定にしているにも関わらず再利用できないのはなぜでしょうか?

Excel Process Scope
└─Use Excel File (“Config\config.xlsx”)
└─ Read Range

  • Sheet Name: “Sheet2”
    └─Use Excel File (“Config\config.xlsx”)!error occurred!
    └─ Read Range
  • Sheet Name: “Sheet1”
    └─Use Excel File (“Setting\Setting.xlsx”)
    └─ Read Range
  • Sheet Name: “Sheet1”

Improved Plan:

Excel Process Scope
└─Use Excel File (“Config\config.xlsx”)
└─ Read Range

  • Sheet Name: “Sheet2”

Excel Process Scope
└─Use Excel File (“Config\config.xlsx”)
└─ Read Range

  • Sheet Name: “Sheet1”

Excel Process Scope
└─Use Excel File (“Setting\Setting.xlsx”)
└─ Read Range

  • Sheet Name: “Sheet1”

Namaste @gorby :folded_hands:

The error happens because you are trying to open the same file multiple times inside one Excel Process Scope. Even with “reuse Excel Process Scope” enabled, UiPath does not reuse the session if you add multiple Use Excel File for the same file.
Instead, use one Use Excel File for each Excel file. If you need multiple sheets, add multiple Read Range activities inside the same container.

Cheers

Hello @gorby

Excel Process Scope (“Config\config.xlsx”)
├─ Read Range → Sheet2
└─ Read Range → Sheet1

Excel Process Scope (“Setting\Setting.xlsx”)
└─ Read Range → Sheet1

This structure will eliminate the RPC server error and properly reuse Excel processes.

Hi,Thank you for your reply.
However, Read Range of “Config\config.xlsx”“Sheet1” raised the same error as the next line.

範囲を読み込み: ブック: C:\Users\Config\config.xlsx において Sheet1 を現在のシートに設定できませんでした。元のエラー メッセージ: RPC サーバーを利用できません。 (0x800706BA)
How come this happens? May I think this a UiPath bug?

You should use Read Cell Value Activity instead of Read Range Activity if you’re trying to read only one cell as it is shown in the screenshot.

No, my notation read entire sheet from A1 cell to end according to my experience.

Hey @gorby read all sheets you need before entering the loop Read Range ("Sheet2") → dt_Sheet2 Read Range ("Sheet1") → dt_Sheet1 then run your For Each Row on dt_Sheet2.

Cheers

  1. Use one Use Excel File activity (or one Excel Process Scope) per workbook.
  2. Read all needed sheets inside that single scope.
  3. Ensure Excel isn’t already open elsewhere.
  4. Optional: Add a tiny delay between reads or use Legacy Excel activities if needed.

Based on the information you provided, I don’t believe there is a mistake in my code. One possible reason it isn’t working could be that this project was created by copying an older project and then modifying it. The original project has similar code but runs without any issues. It seems that in UiPath, there are cases where modifying old code can cause it to stop working.

You’re right — the issue may not be in your logic.
When projects are copied from older ones:

. Hidden settings or mismatched activity versions can break Excel Process Scopes.
. The safest fix is to start fresh and bring over only the XAML files and variables.

Starting a large project from scratch is a lot of work :rofl: , so I hope UiPath will change the specifications to allow older projects to be copied and modified without issues.:rofl:

Regards,

Gorby

Let me confirm one thing. If we migrate the XAML files, isn’t it unnecessary to migrate the variables as well?

Hi,hasty guy,

You misunderstood my situation. There are no loops before and after Excel Process Scope.

1 Like