Is there any possibility to switch off option Strict at UI path Invoke Code

Is there any possibility to switch off Option Strict at UI path Invoke Code?

When i try to run VB.NET code via Invoke Code i stumble into late binding errors.

Example:
When i tried to create Pivot and tried to add fields but option strict on disallows me to add fields.
Below is the code
pt = wba.PivotCaches.Create(Microsoft.Office.Interop.Excel.XlPivotTableSourceType.xlDatabase, SourceData:=“src_data”).CreatePivotTable(TableDestination:=sheet_temp.Range(“A1”))

pt.PivotFields(“field name”).Orientation = Microsoft.Office.Interop.Excel.XlPivotFieldOrientation.xlPageField

1 Like

fast answer its not possible and, if it is you will probably make crash other parts of uipath.

Below code overcomes the late binding issue for the orientation
pt.AddDataField(pt.PivotFields(“field name”)).Orientation = Microsoft.Office.Interop.Excel.XlPivotFieldOrientation.xlColumnField

Late bounded Error line
pt.PivotFields("field name ").Orientation = Microsoft.Office.Interop.Excel.XlPivotFieldOrientation. xlColumnField

1 Like