I am using Invoke VBA activity within Excel Activity Scope with Save Changes as not checked. Still somehow it always Saves excel file. I do not want to save every time as file size of excel is crossing 100 MBs and saving this file everytime causes long BOT runtimes.
It is saving when execution steps out of Invoke VBA activity. It can be seen saving as Visible is marked in the Excel scope activity. Below is snap of the activity and properties.
Sub applyFilter(in_Criteria As String, in_SheetName as String, in_FieldIndex as Integer)
Dim FilterArray() As String
FilterArray= Split(in_Criteria, ",")
For i = LBound(FilterArray) To UBound(FilterArray)
FilterArray(i) = Trim(FilterArray(i))
Next i
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets(in_SheetName)
ws.Range("A1").AutoFilter Field:=in_FieldIndex, Criteria1:=FilterArray, Operator:=xlFilterValues
End Sub
I did find that existing workbook object used in Excel scope when created had a AutoSave enabled. I will disable it and give it a try, also update on forum if that is the cause of issue.
Update
Disabling the AutoSave while creating workbook file that outputs Workbook object solved issue. Thanks @Petar_Soce