Error getting value from 'RowCount' on UiPath.Excel.RangeValue after a macro run

Hello everyone,

I am getting an error when trying to run an Excel macro. It works fine when I run it myself but when I try and run it in studio it throws this error:

Error Details

25.0.166-cloud.20077+Branch.release-s166.Sha.c4d7c09133133299e9e2351889dbd005463a3473.c4d7c09133133299e9e2351889dbd005463a3473

Error getting value from ‘RowCount’ on ‘UiPath.Excel.RangeValue’.

System.Exception: Error getting value from ‘RowCount’ on ‘UiPath.Excel.RangeValue’. —> Newtonsoft.Json.JsonSerializationException: Error getting value from ‘RowCount’ on ‘UiPath.Excel.RangeValue’. —> System.NotSupportedException: Specified method is not supported. at UiPath.Excel.RangeValue.ConvertToDataTable(RangeValue rangeValue, Boolean useRawValues)
at UiPath.Excel.RangeValue.op_Implicit(RangeValue rangeValue)
at UiPath.Excel.RangeValue.get_RowCount()
at lambda_method444(Closure, Object)
at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object target)
— End of inner exception stack trace —
at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at UiPath.Executor.Persistence.CallbackWrapperConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at UiPath.Executor.Persistence.JsonWorkflowSerializer.SaveWorkflowInstance(IDictionary2 workflowInstanceState, Stream destinationStream) at UiPath.Executor.Persistence.RobotInstanceStore.<>c__DisplayClass13_0.<SaveWorkflow>b__0(Stream stream) at UiPath.Executor.Persistence.RobotInstanceStore.WithPersistenceStream(Guid instanceId, Boolean create, Action1 action)
at UiPath.Executor.Persistence.RobotInstanceStore.SaveWorkflow(InstancePersistenceContext context, SaveWorkflowCommand command)
at UiPath.Executor.Persistence.RobotInstanceStore.TryCommandAsync(InstancePersistenceContext context, InstancePersistenceCommand command)
at UiPath.Executor.Persistence.RobotInstanceStore.<>c__DisplayClass9_0.<g__TryCommandAndYield|0>d.MoveNext()
— End of inner exception stack trace —
at System.Activities.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Activities.Runtime.DurableInstancing.InstancePersistenceContext.EndOuterExecute(IAsyncResult result)
at System.Activities.WorkflowApplication.UnloadOrPersistAsyncResult.OnPersisted(IAsyncResult result)
at System.Activities.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
— End of stack trace from previous location —
at System.Activities.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Activities.WorkflowApplication.IdleEventHandler.OnStage2Complete(IAsyncResult lastResult, WorkflowApplication instance, Boolean isStillSync)
at System.Activities.WorkflowApplication.EventFrame(IAsyncResult result)

Any Ideas on what I can do to fix this?
I have the Use Excel file open the file I want to transform, then a Use Excel file with my MacroBook with the Run Spreadsheet Macro activity inside that. With all of that inside the same Excel Process Scope.

Hi @Fields_Dakota

Pls check in that machine, excel macro feature/setting should enabled. And also check excel add in properly working or not.
Check it should visible something like that

Happy Automation

Thank you for your quick reply
These are my settings currently:

I can see the sheets in my excel file (the plugin seems to be working?):

I have also ran the repair tool:

None of this has helped so far. I do not understand as it was working Monday and all of the sudden it’s not. I have only moved the location of the call. It is still doing the same thing just in a different location in the flow. I replaced the activity card, and it is still happening.

@Fields_Dakota

Can you please show some screenshot of the activity properties and tell what macro does and what are the inputs and outputs?

did you happen to update excel?

cheers

@Anil_G
A few screenshots



The Flow

The VBA code takes raw data and parses it so UiPath can more easily use it later in a Terminal action.
Data like this (scraped table data from a web page):
{E71F2F99-1A22-433C-9FBB-B52CAB00DB1F}

to this (more human and machine readable):
{8892A88C-D8A1-4A5D-B1B0-112514D96405}

I’m sure I didn’t do it the best way possible but it works. It doesn’t create or remove sheets. It only transforms data within them. Deleting rows and adding data and such. Unfortunately it is confidential data and I cannot share it all.

@Anil_G @prashant1603765
Thank you for your previous help,
Update. I created it in a new project using the same packages and activity properties and it worked. I extracted the xaml file and inserted it into my current project file and it is still giving me the RowCount error. I have no idea what is going on. Is there something wrong with this project? Is there a way to clear project temp files or have it recompiled somehow?

Thanks!

1 Like

@Fields_Dakota

try launch method autoamtion

is it failing on run macro only?

as the error seems more becasue of no exact raange being found in excel for UiPath activities

also its weird to see the same xaml working on others and not working here

one thing you can try is to remove all the hidden folders and then reopen project specifically the folders starting with dot

but make sure to take a backup

cheers

I completely recreated this workflow, and it works. No idea what caused the issue as I cannot recreate it in a different project. Sorry if anyone else has this issue. I hope your workflow wasn’t as large as mine.

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