Filtering with VBS

It can take a lot of time to go to the dataset and process in large excels or it can cause the process to fall into the “garbage collection” error. After reducing the data we have by filtering it if possible, we can perform operations with excel activities. Filtering can be done with the vbs code below.

The “2” in the AutoFilter field represents the 2nd column.

Set objXLApp = CreateObject("Excel.Application")
objXLApp.Visible = false
Set objXLWb = objXLApp.Workbooks.Open("${progress}rapor.xlsx")
Set oSheet = objXLWb.Worksheets(1)  
oSheet.Range("B1").AutoFilter 2,"=UK"

objXLWb.save
objXLWb.close false
objXLApp.Quit

Set objXLWb = nothing
Set objXLApp = nothing