Hello all,
I am getting an error when using the "Close Excel" action in Power Automate Desktop. I am using it to close and save my Excel file in Power Automate Desktop. However, I am getting this error I couldn't find any more details on the common troubleshooting errors page here. https://learn.microsoft.com/en-us/troubleshoot/power-platform/power-automate/desktop-flows/troubleshoot-excel-errors
From the error message (listed below), I couldn't find anything about what "COM object that has been separated from its underlying RCW cannot be used" meant. Would someone be able to help me out? I wasn't sure if this was a OneDrive issue (as the file is being saved to OneDrive) or something else that could be fixed up.
Here is the full error message:
Problem while executing action 'CloseAndSaveAs'. Failed to close Excel instance.
Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Failed to close Excel instance. ---> System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
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.InvokeMethod(Object o, String methodName, Object[] methodArgs)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.CloseExcel(Variant excelInstance, Variant documentPath, Int32 save, Int32 saveAsFormat, String xmlMapName)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.CloseExcel.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)