Invoke Code Issue - Method not found: 'Microsoft.CodeAnalysis.SyntaxTree

Hi All,

I am trying to close Active excel file using invoke code activity but getting below error.

Method not found: ‘Microsoft.CodeAnalysis.SyntaxTree Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText(System.String, Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions, System.String, System.Text.Encoding, System.Collections.Immutable.ImmutableDictionary`2<System.String,Microsoft.CodeAnalysis.ReportDiagnostic>, System.Threading.CancellationToken)’.

image


image

I am using Studio 2020.10.4 and UiPath.System.Activites 21.10.3 version also imported names spaces.

Could you please help me understand what is missing in my solution and how can I overcome this issue.

Hi,

Please refer the below post at the end our forum members discussed on this issue. the temporary solution would be downgrading the System.Activities package to 20.10.4 resolve the issue. please try downgrade the system activity package and let us know. Thanks.

Hi @kirankumar.mahanthi1

I tired that one but it’s not working for me.
Getting below error.

Hi,

Can you try to update Excel package to the latest?

Regards,

Hi @snehal23 ,

Did you install the microsoft.office.interop.excel package in your studio. Please confirm. Thanks.

Yes, I already installed it but still getting this issue

image

I am using Excel package of 2.11.4 this version

Hi,
Can you try to define it as not Microsoft.Office.Interop.ExcelApplication but Microsoft.Office.Interop.Excel.Application ?
(And also Microsoft.Office.Interop.Excel.Workbook)

Regards,

Hi,

i think it is coding error you have to define the excel object like below and it will work. Thanks.

Dim excelApp As Microsoft.Office.Interop.Excel.Application

Dim wb As Microsoft.Office.Interop.Excel.Workbook

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

wb= excel.Workbooks.Open(“Your excel workbook Path”)

excelApp.Visible=False.

wb.close

Did we found a permanent solution? Issue is because when I downgrade the version of System.Activities to 20.10.4, my other functionalities stops working. Need help on this as soon as possible.