hello,
First of all i want to know, is it good practice to use combination of studio and studiox excel activities?. because i can able to find some activities in studiox for which i have used custom activities in earlier days of studio projects. Right now i’m using both studio and studiox excel activities in a single workflow. (Specifically used studiox activity for autofit range and formattting). I do get the following errors often, when i use USE EXCEL activity after EXCEL SCOPE activity.
System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Excel.ApplicationClass.get_Version()
at UiPath.Excel.Helpers.ExcelInteropHelpers.TryGetMajorVersion(Application excelApp, Int32& version)
at UiPath.Excel.ExtendedWorkbookApplication.ExtendedAttachOrCreateNew(WorkbookArguments workbookArguments, IExcelComAppManager comAppManager, ComAppOptions options, ExcelStartOptions excelStartOptions)
at UiPath.Excel.ExtendedWorkbookFactory.Create(Boolean attachOnly)
at UiPath.Excel.WorkbookQuickHandle.SafeGetWorkbook(Boolean attachOnly)
at UiPath.Excel.WorkbookQuickHandle.OpenWorkbook()
at UiPath.Excel.Activities.Business.ExcelApplicationCard.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
It sometime works and sometime doesn’t. I don’t find any answer from forum. Could anyone please give me an idea to this issue?
Note : I have tried by giving delay between two types of excel scope activities.and also tried to kill excel before using studiox excel activity and after using studio’s excel scope activity.