Assembly reference error while using excel operations in Invoke code actvity

Hi,

kindly please go through the error facing in invoke code activity when using Excel operations in it.

Invoke Code: No compiled code to run
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Application’. Are you missing an assembly reference? At line 1
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Workbook’. Are you missing an assembly reference? At line 2
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Worksheet’. Are you missing an assembly reference? At line 3
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Worksheet’. Are you missing an assembly reference? At line 3
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Application’. Are you missing an assembly reference? At line 4
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Worksheet’. Are you missing an assembly reference? At line 6
error BC31539: Cannot find the interop type that matches the embedded type ‘Microsoft.Office.Interop.Excel.Worksheet’. Are you missing an assembly reference? At line 7
error BC30456: ‘XlPasteType’ is not a member of ‘Excel’. At line 11

before i used to add a line in xaml it worked fine but now it is not working

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

Regards,
A Manohar

Add namespace ‘Microsoft.Office.Interop.Excel’ from namespace tab

@vikashkumarvivek00

can you explain me clearly kindly provide screen shot for reference

Regards,
A Manohar

Have you added the namespaces of Microsoft.Office.Interop.Excel from variable pane ?

@vikashkumarvivek00

No i didn’t added

Please add and then check it again…I hope it will work

@vikashkumarvivek00

still facing the same error after adding also

xaml code header

Can you please open xaml file in Notepad and check for Microsoft.Office.Interop.excel in assembly reference part and X string part?
If it is there then no need to do anything else you have to add manually…

1 Like

@vikashkumarvivek00

It is present

Kindly verify xaml for reference
BnC.xaml (987.1 KB)

@Manohar1

Click on manage packages and search for Microsoft.Office.Interop.Excel
and install it

Thanks @HareeshMR and @vikashkumarvivek00

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