Power Query Problems

Fix Power Query Loading During a Scheduled Excel Refresh

Elise WilliamsElise Williams Nov 20, 2026 868 views

Question details

A user needs a scheduled Excel macro to wait until Power Query is ready before starting a refresh.

Fix Power Query Loading During a Scheduled Excel Refresh
Product
Microsoft Excel Power Query
Device & OS
Windows
Scenario
Windows Task Scheduler launches Excel and a macro that refreshes Power Query data.
Observed behavior
The macro fails when it starts, but completes after the user selects Debug and then Run.
Before you start

Check the task's action and account in Windows Task Scheduler, and confirm that the workbook and its data sources are accessible under that account. Open the workbook manually in Excel and verify that the query refreshes from the Data tab.

Solution 1Recommended

Control Excel startup and retry transient refresh failures

Use this approach when the scheduled macro appears to run before Excel or the required query components are ready.

The original issue was reported as resolved without a specific fix. The steps below are troubleshooting guidance for similar timing-related failures.

A fixed delay alone cannot confirm that Power Query is ready. A bounded retry can help with a temporary startup failure, but it should not repeat operations that would create duplicate data or other unintended changes.

1
Check the scheduled launch

Open Task Scheduler, select the task, and choose Properties > Actions. Check how Excel and the workbook or automation script are launched, and identify where the refresh macro starts.

2
Separate startup from refresh

In Excel, press Alt+F11 and inspect the workbook's startup code or the macro called by the automation script. Arrange for the refresh routine to run only after the workbook is open and the required components have had time to initialize.

3
Add a bounded retry

In the VBA editor, add error handling around the refresh operation to record the error and retry only a limited number of times for a suspected transient startup failure. Stop and report the error if the retries are exhausted.

4
Test under the task account

In Task Scheduler, select the task and click Run. Check the task history and the macro's error log, then confirm in Excel that the query results were refreshed as expected.

Control Excel startup and retry transient refresh failures
Check the actual error: A retry will not fix missing credentials, unavailable data sources, or a disabled dependency. Review the logged error if the task continues to fail.
Free Microsoft Office alternative

Work with Excel spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Excel spreadsheets. Its format compatibility helps you move everyday spreadsheet work over easily, although it does not fix Microsoft Excel's Power Query startup or scheduled macro behavior.

Open and edit common Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface for everyday data workChoose a free, lightweight Office alternativeReview spreadsheet results from Excel in a compatible application
QA img-9

Frequently Asked Questions

Why does the macro work after I press Debug and Run?

The pause may give Excel or a required component more time to initialize, but it does not prove that startup timing is the cause. Record the original VBA error and test the refresh manually from Excel's Data tab.

Is a fixed delay enough before refreshing Power Query?

A delay may help in some cases, but startup time varies. Inspect the launch sequence in Task Scheduler and use a bounded retry with error logging rather than relying only on a fixed wait.

Where can I check which account runs the scheduled task?

Open Task Scheduler, select the task, and choose Properties > General. Check the account listed under Security options and verify that it can access the workbook and data sources.

Will WPS Office fix the scheduled Excel Power Query macro?

No. The scheduled macro and Power Query startup behavior belong to Microsoft Excel. WPS Office can be used as an alternative for common spreadsheet work, but the Excel automation should be troubleshot in Excel and Task Scheduler.