Skip to main content
Question

Excel Power Query Not Refreshing on Virtual Machine

  • January 14, 2026
  • 4 replies
  • 94 views

Forum|alt.badge.img+5

I’m using the Advanced Excel action in a bot. The Excel file contains a Power Query that is set to automatically refresh on opening.

Here’s the issue:

  • When I run the bot on a virtual machine as a scheduled unattended bot, the Power Query does not refresh automatically.
  • I tried simulating keystrokes (using the keyboard shortcut for refresh), but that doesn’t work either.
  • Permissions are set at the organizational level.
  • Interestingly, when I’m logged in and testing manually on the VM, the refresh works fine. The problem only occurs during scheduled runs.

Has anyone encountered this before? Is there a workaround to ensure the Power Query refreshes when the bot opens the file during a scheduled run?

Thanks in advance for any suggestions!

4 replies

Forum|alt.badge.img+3
  • Navigator | Tier 3
  • January 14, 2026

Is this modern Excel versions?


Forum|alt.badge.img+5
  • Author
  • Navigator | Tier 3
  • January 14, 2026

Yes, it’s using the most recent desk top version, using Excel Advanced actions in AA


Forum|alt.badge.img+3
  • Navigator | Tier 3
  • January 14, 2026

Pls check your Connect query which using from Excel to database.

Put error handle and chek the bot in unattended mode


Forum|alt.badge.img+7
  • Navigator | Tier 3
  • January 16, 2026

For my excel files which need power query refreshes, I have had to use macros to do the refresh.

 

This was mainly for the fact that Automation Anywhere was not aware of when the “refresh all” process completed, so I could not rely on that to continue without manually adding delays.

If you run a macro to do this, the bot will become aware of when it completes.

 

My macro has inputs for unprotecting/protecting the workbook, but you could remove these steps.

Sub RefreshmyQuery(ByVal sPassword As String)
Sheets("Terminated_User_Report").Unprotect Password:=sPassword
ActiveWorkbook.Connections("Query - Terminated_User_Report").Refresh
ActiveWorkbook.Connections("Query - Unique_Header_Records").Refresh
ActiveWorkbook.Connections("Query - Supervisor_List").Refresh
Sheets("Terminated_User_Report").Protect Password:=sPassword, DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True
ActiveWorkbook.Protect Password:=sPassword, Structure:=True
End Sub