web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Issue running loops

(0) ShareShare
ReportReport
Posted on by 10

I am running into an issue running this flow. It will work without issue the first time I run it, but as soon as it loops back to generate a second report, I get an error ("can't find active worksheet"). The file I am directing the loop to is still open after the flow finishes the first round and all I need it to do is find the excel worksheet ("course information") within the same file (step 7). Any idea why this is happening?

 

PA-loop.png

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Before the error occurs, try putting a Get worksheets, or whatever the action is called, to see which are available. Is it on the list, or did it disappear?

  • VJR Profile Picture
    7,635 on at

    Put a breakpoint after the first iteration, and check whether the file is open, has the required sheet and is pointing to the right Excel Instance.

  • emac Profile Picture
    10 on at

    I did try that and the instance is still available.

  • emac Profile Picture
    10 on at

    Yup, the file is still open, the required sheet is there (I triple checked the spelling / case and it matches) and it is pointing to the correct instance.

  • VJR Profile Picture
    7,635 on at

    Can you print the complete error message.

  • emac Profile Picture
    10 on at

    Failed to activate worksheet.

     

    Details:

    Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to activate worksheet. ---> System.Runtime.InteropServices.COMException: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
    at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.GetProperty(Object o, String propertyName)
    at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.TryFindWorksheet(Object& sheet, Object activeWorkbook, FindWorksheetModeEnum findMode, String nameToFind, Int32 index)
    at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.SetActiveWorksheet(Variant excelInstance, Variant sheetIndex, Variant sheetName, Int32 findWorksheetMode)
    --- End of inner exception stack trace ---
    at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.SetActiveWorksheet.Execute(ActionContext context)
    at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Just out of curiosity:  try an attach to Excel action at the beginning of the loop to reset the instance.

     

    Best of luck!

  • emac Profile Picture
    10 on at

    If I do that, it'll create a new excel instance and the rest of the flow won't work though.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    No, you can tell it which instance to point to:

    MichaelAnnis_0-1648222140290.png

     

  • VJR Profile Picture
    7,635 on at

    @emac, based upon some research that I just did could you try by giving a wait for few seconds before activating the worksheet and see if it changes anything.

     

    Just to save some time back and forth between our chats can you do a web search on the error "The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)"

    and see various options. This is a common error and not related to PAD which just displays the error from its own error handler. The error has various solutions so try the one that works out in your scenario.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard