Interop.Excel.Application is not defined


#1

Hi,

I’ve tried importing the Microsoft.Office.Interop.Excel namespace, then within an Invoke code activity putting the following:
Dim xl As Microsoft.Office.Interop.Excel.Application

However, I get the following error message:

Main has thrown an exception

Source: Invoke code

Message: Error compiling code
error BC30002: Type ‘Microsoft.Office.Interop.Excel.Application’ is not defined. At line 1

Exception Type: ArgumentException

System.ArgumentException: Error compiling code
error BC30002: Type ‘Microsoft.Office.Interop.Excel.Application’ is not defined. At line 1

But Intellisense in Invoke Method window gives Microsoft.Office.Interop.Excel.Application namespace.

Did something solve this problem?

Thank you.


Extracting hyperlinks from Excel
#2

I am also curious about this.


#3

Hi Alex,

Were you able to solve the issue? thanks


#4

Do you have the below assembly in your xaml, if not add it manually and restart your project and try again.

image


How to set the name space and assembly references for Uipath File
Import Microsoft.Office.Interop.Excel does not work
InvokeCode Example
Invoke Code activity with RestShart API calling Issue
Invoke Code doesn't work when trying to manipulate Excel because of missing Assemblies
#5

Thank you very much, after adding this line UiPath could find the reference.


#6

Hi Guys, I fixed that, as vvaidya mentioned, but have still the same issue: error BC30002: Type ‘Microsoft.Office.Interop.Excel.Application’ is not defined. At line 1

Before this fix, there was an error: Cannot find the interop type that matches the embedded type ‘microsoft.office.interop.excel.application’… Any Idea? Thanks.


#7

Check if “Microsoft.Office.Interop.Excel” is not automatically added

xmlns:moie=“clr-namespace:Microsoft.Office.Interop.Excel;assembly=Microsoft.Office.Interop.Excel”


#8

yes. adding the above assembly reference, workflow works fine. But when I edit the workflow in studio, this manually added reference getting deleted all the time. Please help.


#9

This works for me. Just wondering why this entry is not automatically entered by UiPath Studio in the xaml file.