You set up a scheduled refresh for your Power Query data in Excel, but the refresh fails when it runs automatically. When you click Refresh All manually, the data updates without errors. This problem usually happens because of credential settings, file path issues, or Excel’s background refresh mode. This article explains why scheduled refreshes fail while manual refreshes succeed and provides step-by-step fixes to resolve the issue.
Key Takeaways: Why Scheduled Power Query Refresh Fails
- Data > Queries & Connections > Properties > Usage: Check the “Refresh data when opening the file” and “Refresh every X minutes” settings to confirm scheduled refresh is enabled.
- Data Source Settings > Credentials > Edit Permissions: Store credentials as Windows Authentication or use a saved password for the data source to prevent authentication failures during scheduled refresh.
- File > Options > Data > Disable Power Query background refresh: Turn off background refresh to force scheduled refreshes to run in the foreground and reveal error messages.
Why Manual Refresh Works but Scheduled Refresh Fails
Power Query uses the same query engine for both manual and scheduled refreshes. The difference is the execution context. When you refresh manually, Excel runs the query in the foreground with your current Windows user credentials and network access. A scheduled refresh runs in the background, often triggered by Excel’s timer or the workbook open event. In the background, Excel may not have access to the same credentials, network drives, or file paths that are available during an interactive session.
The most common root causes are:
- Credentials not saved: The data source requires authentication, and the scheduled refresh cannot prompt you for a password. If credentials are not stored in the Data Source Settings, the refresh fails.
- Network path unavailable: A scheduled refresh that runs when the workbook opens may execute before the network drive is mapped. Manual refreshes happen after the drive is already connected.
- Background refresh disabled: Excel has a setting that controls whether queries refresh in the background. If this is turned off, scheduled refreshes may not start at all.
- Power Query privacy levels: Privacy level settings can block data combination during a scheduled refresh if they are set too restrictively.
Steps to Fix Scheduled Power Query Refresh Failures
Follow these steps in order. Test the scheduled refresh after each step to identify which fix resolves the issue.
- Step 1: Check scheduled refresh settings in the workbook
Open your workbook. Go to Data > Queries & Connections. In the Queries & Connections pane, right-click the query that fails and select Properties. On the Usage tab, verify that the checkbox “Refresh data when opening the file” is checked. If you want periodic refresh, also check “Refresh every X minutes” and set an interval. Click OK. - Step 2: Store credentials in Data Source Settings
Go to Data > Get Data > Data Source Settings. Select the data source that your query uses and click Edit Permissions. Under Credentials, choose Windows Authentication or Basic and enter the username and password. Check the box “Save this password” if available. Click Connect. This ensures the scheduled refresh has stored credentials and will not prompt for a password. - Step 3: Disable Power Query background refresh
Go to File > Options > Data. Under Power Query Query Editor, uncheck the box “Enable background refresh for data connections.” Click OK. This forces all scheduled refreshes to run in the foreground, which reveals any error messages that were hidden during background execution. After you identify the error, you can re-enable background refresh if you prefer. - Step 4: Change privacy level settings
Go to File > Options > Trust Center > Trust Center Settings > Privacy Options. Under Privacy, select “Ignore the Privacy Levels and potentially improve performance.” Click OK. This setting allows Power Query to combine data from different sources during a scheduled refresh. Only use this if you trust all data sources in the workbook. - Step 5: Use full file paths instead of mapped drives
If your query loads data from a network file, edit the query source to use the full UNC path instead of a mapped drive letter. For example, changeZ:\Data\Sales.xlsxto\\Server\Share\Data\Sales.xlsx. Mapped drives are user-specific and may not be available during a scheduled refresh that runs when the workbook opens. - Step 6: Test the scheduled refresh
Close and reopen the workbook. The scheduled refresh should run automatically when the file opens. If it still fails, check the error message. Common errors include “Data source credentials not found” or “File or folder not found.” Address the specific error by revisiting the relevant step above.
If Scheduled Refresh Still Fails After the Main Fix
Power Query refresh fails with the error “Credentials required”
This error indicates that the stored credentials are not valid or were not saved correctly. Go back to Data > Get Data > Data Source Settings. Select the data source and click Edit Permissions. Delete the existing credentials and re-enter them. Ensure you check the box to save the password. If your data source uses Windows Authentication, verify that your Windows account has permission to access the data source.
Scheduled refresh works on one computer but not on another
Credentials and file paths are stored per user and per computer. If you share the workbook with another user, they must configure their own Data Source Settings on their machine. The scheduled refresh will use their credentials, not yours. Ask the other user to follow the steps above on their computer.
Power Query refresh fails when Excel is closed
Scheduled refresh set to run every X minutes only works while Excel is open. If you close Excel, the refresh stops. To refresh data when Excel is not running, you need to use Power BI or a scheduled task that opens Excel and triggers the refresh. This is a limitation of Excel’s scheduled refresh feature.
Background refresh checkbox keeps re-enabling itself
This happens when Excel updates or when you open a workbook created in an older version. After disabling background refresh in File > Options > Data, close and reopen Excel. If the setting reverts, check if a group policy or add-in is overriding the setting. Temporarily disable all COM add-ins to test.
Manual Refresh vs Scheduled Refresh: Key Differences
| Item | Manual Refresh | Scheduled Refresh |
|---|---|---|
| Execution context | Foreground, interactive user session | Background, may run before user login |
| Credential prompt | User can enter credentials interactively | Must use stored credentials; no prompt appears |
| Network drive access | Uses user’s mapped drives | Requires UNC paths; mapped drives may be unavailable |
| Error visibility | Error messages appear in Excel | Errors may be hidden; background refresh must be disabled to see them |
| Privacy level behavior | Privacy levels are enforced per user settings | Privacy levels can block combination; may need to ignore privacy levels |
Now you can diagnose and fix scheduled Power Query refresh failures by checking credentials, disabling background refresh to see errors, and using UNC paths. Start by storing the correct credentials in Data Source Settings. If the refresh still fails, disable background refresh temporarily to reveal the exact error message. For workbooks shared across users, each user must configure their own credentials.