Activesheet expression is not recognized in invoke code activity. Microsoft.Office.Interop.Excel package is installed

The following code inside Invoke code activity throws error ‘ActiveSheet’ is not declared . Pivot Tables and pivot field is declared. The Microsoft.Office.Interop.Excel package is installed.

ActiveSheet.PivotTables(“name”). PivotFields (“custno”).ShowDetail= True

1 Like

The VB won’t recognize the active sheet class as we get that from Macro. Use

worksheetVariable.Active() to activate a sheet and then

worksheetVariable.PivotTables(“name”). PivotFields (“custno”).ShowDetail= True

@bannari90. I hope I’m clear

no worries
Welcome to uipath community
mention your sheetname directly where this pivot table exists and try once
yoursheetname.PivotTables(“name”). PivotFields (“custno”).ShowDetail= True

Cheers @bannari90

Yes.It is clear