Write Cell Error When Running on VM

Hello,
I have an excel application scope where i have multiple write cell activities that must execute. I can run locally on machine without issue, but when i publish and run through orchestrator on a VM i get the following error:

Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.Office.Interop.Excel.Worksheet’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{000208D8-0000-0000-C000-000000000046}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Inside my excel application scope i have multiple write ranges that execute correctly on the VM. It seams the only issue im having is getting the Write Cells to function properly without error on the VM.
image

The following 5 sequences inside the excel application scope pictured above do not execute due to the error:

My first sequences looks the this: I have a for each loop and then a switch statment. Depending on what the name is, i can then determine what cell to write to.

Any ideas as to why the write cell activities do not work when running on a VM?

You might do a search online for possible solutions. Seems like this error is being caused by a setting on the VM.

You could try this solution:

Regards.

This was due to UiPath Robot on the VM - (not studio) having a different excel package. There is no clean way to update the packages on Robot.

This link should help if anyone else runs into the same issues that I had:

Note- If you create a custom activity you need to do the same steps to have the custom activity run on a VM that only has Robot.