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.
Please suggest how to achieve this.
How did you confirm the file is getting saved in the mid run?
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.
Could you please share the version of your Excel activities package, as well as a sample script that reproduces the issue?
I can see that Save changes option is not selected in your configuration, so it should indeed work fine in theory.
Is the save changes enabled or disabled inside the excel application scope which created wb object ? Guessing somewhere earlier in the flow ?
Version excel activity package is as under.
VBA code used is as under.
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))
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets(in_SheetName)
ws.Range("A1").AutoFilter Field:=in_FieldIndex, Criteria1:=FilterArray, Operator:=xlFilterValues
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.
Disabling the AutoSave while creating workbook file that outputs Workbook object solved issue. Thanks @Petar_Soce
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.