REMOTE DESKTOP INVOKE CODE ACTIVITY VB.NET Code not working

In the remote desktop I don’t have Excel application installed, but I do have uipath studio installed. Because of this I am using the Invoke Code activity with VB.net code to do the excel activities.

I am trying to run a process to retrieve the sheet name & then update the sheet name to a new value.

Here is the code

Code to retrieve worksheet names:

Try

app = New Microsoft.Office.Interop.Excel.ApplicationClass

workbook= app.Workbooks.Open(Filename.Trim)

worksheetnames = New List(Of String)()

For Each worksheet In app.Sheets

worksheetnames.Add(worksheet.Name)

Next

Catch ex As Exception

End Try

Code to update worksheet name:

Try

app = New Microsoft.Office.Interop.Excel.ApplicationClass

workbook= app.Workbooks.Open(Filename.Trim)

worksheet = CType(workbook.Worksheets(Sheetname.Trim),Microsoft.Office.Interop.Excel.Worksheet)

worksheet.Name = NewWorkSheetName

workbook.Save

Catch ex As Exception

End Try

Here is the validation error.
image

I have added Microsoft.Office.Interop.Excel packages both in the Manage packages & Imports tab.
I have also checked if the xaml file has the Microsoft.Office.Interop.Excel assembly reference and the Microsoft.Office.Interop.Excel namespace as well and both are already present in the file.
The code runs well in the local system (I have excel application in local) but when I try to run the process in the Remote Desktop (where there is no excel application), it gives the above error.

I wanted to know if I can perform excel activities without the application being installed.
Any help would be appreciated.

Hi, @devank157

Edit the main.xaml and the Xaml in which you are using the invoke code activity
Add Microsoft.Office.Interop.Excel manually and save the file exit the studio and open the project.

This will help.