マクロ実行でエラー

「スプレッドシートのマクロを実行」アクティビティを使用してマクロを実行すると以下のエラーになります。
ーーーーーーーーーーーーーーーーーーーーーーーー
0x800A01A8

at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
ーーーーーーーーーーーーーーーーーーーーーーーー
Studioでのデバッグ実行ではエラーにならないのですが、Assistantから実行するとエラーになります。(StudioとAssistantは別の端末です。)
また、Assistantから実行している端末で、マクロを直接実行するとエラーになりません。
使用しているファイルはすべて同じです。

以下、試しましたが解消しませんでした。
・UiPathのアップデート(Studioに合わせて24.10.1にしました)
・Excelのトラストセンターでマクロを有効に設定
・M365とOfficeの修復

お力を貸してください・・・。

Hello @kana612 Modify your macro to avoid ActiveWorkbook or ActiveSheet and always reference the workbook explicitly, then run it inside an Excel Application Scope in UiPath.

Also try using Invoke VBA or Execute Macros Activity to execute the macro.

Cheers

VBAを呼び出し(Invoke VBA)に置き換えて実行したら以下のエラーになりました。
ーーーーーーーーーーーーーーーーーーーーーーーー
VBA を呼び出し: このアクティビティを動作させるには、Excel で [VBA プロジェクト オブジェクト モデルへのアクセスを信頼する] オプションを有効化する必要があります ([ファイル] > [オプション] > [セキュリティ センター] > [セキュリティ センターの設定] > [マクロの設定] > [VBA プロジェクト オブジェクト モデルへのアクセスを信頼する] チェック ボックスをオンにします)。
ーーーーーーーーーーーーーーーーーーーーーーーー
記載されているExcelオプションの設定は実施済みです。

@kana612 some of the code we are able to achieve by using activate sheet for the excel manipulations. please try using activate sheet methods to make sure that sheet is active in unattended mode.

Okay so follow these steps Open Excel then go to File then Options then Trust Center then Trust Center Settings then Macro Settings:
Enable Trust access to the VBA project object model
Check the Enable all macro (temporarily, for testing)

Cheers

excelのプロセス管理にまつわるエラーのような気がします
studioでは動くがassistantからはだめとなると・・・
ダメもとでExcelの起動からマクロの実行までの間にWait入れてみるとかではだめでしょうか。

アドバイス通り、待機を入れたら解消しました!
ありがとうございました。

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