ExtensionAttribute is ambiguous in the namespace System.Runtime.CompilerServices

Using Excel Microsoft.Office.Interop.Excel
getting error

how to solve it

Hi,

you cannot use both Microsoft.Office.Interop.Excel package and also name space in your studio it will create ambiguity. remove the name space or package to resolve the issue.

Regards,
Kirankumar.

Hi

Yes u r right

But I m getting some syntax error


How to solve thi

Regards,
Supriya

Hi @kirankumar.mahanthi1

Remove the namespace but still the error continues



Thanks and Regards

Hi,

Could you please restart your studio and check if still ambiguous error is popping up.

Regards,
Kirankumar.

Hi

I hope you are using Invoke Code activity

Make sure you have chosen vbnet as Language Property

Cheers @supu123

Hi @kirankumar.mahanthi1

Yes the error continues even after restarting studio
not getting what happening



Thanks and Regards,
Supriya

Hi @Palaniyappan

Yes using invoke code with vbnet as show in the image above
but still getting error

Thanks and Regards,
Supriya

Hi,

Could you open your main xaml and check if you have the below assembly reference related to Microsoft.Office.Interop.Excel as below. then remove the Microsoft.Office.Interop.Excel package from the manage activities panel. some here it is pointing two references that is making issue.

<x:String>Microsoft.Office.Interop.Excel</x:String> under
<TextExpression.NamespacesForImplementation> and
xmlns:moie=“clr-namespace:Microsoft.Office.Interop.Excel;assembly=Microsoft.Office.Interop.Excel” in the namespaces.

Regards,
Kirankumar.

Hi @kirankumar.mahanthi1

There are no such assembly reference in the main file

I have attached below


Removed all restarted studio as well but the error continues

Is there any other way to delete specific excel sheet
Its a bit urgent

Thanks and Regards,
Supriya

1 Like

Hi @supu123 ,

Please remove the package microsoft.office.interop.excel a tivity from your dependencies and tell me what error you are facing for the invoke code.

In your organization if you are allow to use activities from uipath market place use bala.reva.excel actvities. It contains delete sheet activity. If it is urgent try this.

Regards,
Kirankumar.

@kirankumar.mahanthi1

No package in my dependencies
Image below

error is below

Regards,
Supriya

@kirankumar.mahanthi1

This below namespace would be leading to any issues?
xmlns:moie=“clr-namespace:Microsoft.Office.Interop.Excel;assembly=Uipath.Excel”

Because this is present xaml

Regards,
Supriya

yeah please remove and try some where it is referencing multiple times that is causing issue. and please take a backup of main.xaml otherwise some times deleting content in the main.xaml lead to corrupting the xaml file. thanks.

Regards,
Kirankumar.