Invoke VBA activity automatically saves excel file

Hi community,

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.

Hey @JDoshi

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.

I am kind of stuck. It would be great if anybody can help related to this. @loginerror @lakshman @uipath @nisargkadam23 @nitya.tomar @radu_bucur @Krutika_Kotkar @Palaniyappan @Parth_Doshi

Hi @JDoshi

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 ?

1 Like

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))
    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.

Disabling the AutoSave while creating workbook file that outputs Workbook object solved issue. Thanks @Petar_Soce

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.