How the "invoke workflow file" activity works with an external or internal Excel Scope?

Hello everybody,

I need to understand how the “invoke workflow file” activity works with an external Excel Scope (with this “invoke” activity) or internal (with this “invoke” activity).
My main goal is to define modules allowing me reccurent treatments and then call them when I need. For the case of an Excel Scope it is not so obvious.

I am trying to have independent modules. I thought the solution would be to use the invoke workflow file activity.

Case Study: External Excel Scope

My thread:
Parent Workflow → Excel Scope → Invoke Workflow file → Child Workflow → reccurrent activities (independent module - generic processing) → Parent Workflow → specific activities (specific processes) → Excel Scope closure.

Except that this thread does not work.:put_litter_in_its_place:

To be precise:
In a “Master” workflow, I run an Excel Scope. On this scope, I have a list of activity which is reccurente (a treatment on the filters). I wanted to create a child workflow attached to a “Master workflow” via the “Invoke Workflow file” activity.

Basically a module that I could use in other projects. I thought I could directly use this one via the “invoke workflow file” activity.

I tested:
I add the Excel Scope activity and I add the activity ‘invoke workflow file’ to the master I do not mind my arguments, my invoke and my child workflow are well configured and everything is supposed to work.

Except that all the activities that are linked by default to the activity “Excel scope” (for example: Select Range) are simply not identifiable within a scope. As a result, Uipath shows me a configuration error on the “Select Range” activity of my child workflow.

So I suppose there is no parent / child recognition between the scope of my Master workflow and the child workflow via invoke. I can not use this method to modulate my reccurrent processes.

Second case: Excel scope internal to the child workflow

So I tried to directly integrate the Excel Scope activity into my child workflow. The problem is that the Excel Scope closes (Excel file closes) after processing on the child workflow. So I am obliging on the master to restart the Excel Scope activity. I did not find a solution allowing me to leave the excel scope of the child workflow “open” to resume on the master workflow following the treatment …:face_with_monocle:

There may be a solution I am not aware of.

I do not know if I am very clear, if need I can provide printed screens.

Thank you for your time and your explanations.

Thank you

1 Like

+1 for nice explanation :slight_smile:

That’s correct - scope is not transferred between invokes, as the invoked workflow is not executed in the same context (from workflow foundation perspective).
You could try transferring Workbook object as argument, which should keep it open (I think it did in some Excel package version, can’t test now unfortunately). Just remember to close at the end if it does.

Thanks for your quick answer andrzej.kniola. I will test via the workbook. I want you to inform quickly.

thank you very much

Good after several tries and after having discussed with a colleague.
I see that if we want an independent and reusable module. It must respect a few principles. Especially if you end up working with Excel Scope activities.

→ My modules must integrate a complete Excel scope. (Do not have a scope overlap between parent and child - it does not work or it does not work :kissing_smiling_eyes:).
→ My modules must have unique arguments / variables. (Do not have duplicate arguments on multiple invokes within our parent.) :sleeping:
→ It is possible to run my modules using the activities related to the workbook. Overlap is possible but avoid for better maintainability. :exploding_head:

You may not agree with me and I would love to know your vision. Thanks for taking time to respond to me.:man_student:

I leave the topic open 24 hours if you want to make your contribution.

Thanks for your feedback.