How do I refresh Pivot table. after write range activity

I have a excel template:
-For Each Row the template file will copy and rename with a new file name.
-the data will write range in ‘Data’ tab

My question is after the WRITE RANGE activity… How do I code bot to go to another tab ‘Pivot’ and refresh data…(pivot table is set in a predefined template.

Hi
Try with this activity

Cheers @lynaia_harris

is there a way to refresh pivot table…not in the excel application scope

1 Like

Let’s try using hot key Alt+F5

Cheers @lynaia_harris

you can create a template that will refresh the Pivot table automatically whenever the new data is entered. And use the same template for the output files.

Although, if you want to run a VB script, below script from SO will help.

Sub Refresh_All_Pivot()
    Dim Sheet As Worksheet, Pivot As PivotTable
    For Each Sheet In ThisWorkbook.Worksheets
        For Each Pivot In Sheet.PivotTables
            Pivot.RefreshTable
        Next
    Next
End Sub

where do I put this script

that is a .vbs code

you can add your own parameters and save it with extension .vbs and then run in the UiPah using Invoke VB Scipt

If I put this macro on my template will it work?..my bot is creating a copy of template file to create multiple files