


How to automatically refresh data in Excel from an external source
Aug 01, 2025 am 04:53 AMTo make external data in Excel automatically update, you need to enable refresh when the file is opened or set a timed refresh. 1. Enable refresh when file opening: Check "Open file when refresh data" in the connection properties to ensure that the data is automatically updated every time the workbook is opened. 2. Set periodic refresh interval: Set "Every Time" to refresh the number of minutes in the connection properties, which is only valid when the workbook is opened. 3. Use VBA events to trigger refresh: By writing VBA code, you can automatically refresh every 10 minutes and other custom times, and start the process when the workbook is opened. 4. Use Power Query data model: It is recommended that modern Excel users use Power Query and enable background refresh, combined with cloud services, you can achieve timed refresh in shutdown state. Notes include saving credentials, handling errors, selecting appropriate file formats, and optimizing refresh performance. After proper configuration, Excel reports can be automatically kept up to date without manual intervention.
If you're pulling data into Excel from an external source—like a database, web query, text file, or another workbook—you probably want that data to stay up to date without manually refreshing every time. Fortunately, Excel offers several ways to automatically refresh external data . Here's how to set it up.

1. Enable Automatic Refresh When Opening the File
This is the simplest method: Excel refreshes the data every time you open the workbook.
Steps:

- Select any cell in your data table connected to the external source.
- Go to the Data tab.
- Click Queries & Connections (or Connections in older versions).
- In the Workbook Queries or Connections pane, right-click your query or connection.
- Choose Properties (or Connection Properties ).
- Check the box for "Refresh data when opening the file" .
- Click OK .
? This ensures your data is currently every time you open the workbook—ideal for daily reports or dashboards.
2. Set a Regular Refresh Interval (Manual Refresh on a Timer)
Want Excel to refresh every few minutes or hours while the file is open? You can schedule periodic refreshes.

Steps:
- Go to the Data tab.
- Click Queries & Connections .
- Right-click your query → Properties .
- Check "Refresh every" and enter the number of minutes (eg, 5, 30, 60).
- Optionally, check "Refresh background" so Excel remains usable during refresh.
- Click OK .
?? Note: This only works while the workbook is open. If Excel is closed, the timer stops.
3. Use VBA to Trigger Refresh on Events (Advanced)
You can use Excel VBA to automate refreshes based on events like worksheet changes, time of day, or user actions.
Example: Auto-refresh every 10 minutes while Excel is open
- Press
ALT F11
to open the VBA editor. - Insert a new module or use
ThisWorkbook
. - Paste this code:
Sub StartAutoRefresh() Application.OnTime Now TimeValue("00:10:00"), "RefreshData" End Sub Sub RefreshData() ThisWorkbook.RefreshAll StartAutoRefresh ' Reschedule the next refresh End Sub Sub StopAutoRefresh() On Error Resume Next Application.OnTime EarliestTime:=Now, Procedure:="RefreshData", Schedule:=False End Sub
- To start, run
StartAutoRefresh
. To stop, runStopAutoRefresh
.
? Tip: Call StartAutoRefresh
when the workbook opens by adding this to the ThisWorkbook
module:
Private Sub Workbook_Open() StartAutoRefresh End Sub
This method gives you full control but requires macros to be enabled.
4. Use Power Query Data Model (Recommended for Modern Excel)
If you're using Power Query (Get & Transform Data), you can enhance automation:
- After loading data via Data > Get Data , go to Query Options .
- Under Data Load , ensure "Enable background refresh" is checked.
- Combine with "Refresh when opening" or scheduled refresh if using Power BI or Excel Services (in enterprise environments).
? Bonus: In Power BI or SharePoint Online , you can set scheduled refreshes in the cloud—even when your computer is off.
Things to Keep in Mind
- ? Credentials : External sources may require saved login info. Set this in Query Options > Data Source Settings .
- ? Errors : If the source is unavailable, automatic refresh may fail. Test reliability first.
- ? File Format : Save as
.xlsx
or.xlsm
(if using macros). Some features require.xlsb
for large datasets. - ?? Performance : Frequent refreshes of large data can slow Excel. Use background refresh when possible.
Basically, automatic refresh in Excel comes down to:
? Turn on refresh at open
? Set a time interval
? Or use VBA for custom automation
With the right setup, your Excel reports can stay current with minimal effort.
The above is the detailed content of How to automatically refresh data in Excel from an external source. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Grouping by month in Excel Pivot Table requires you to make sure that the date is formatted correctly, then insert the Pivot Table and add the date field, and finally right-click the group to select "Month" aggregation. If you encounter problems, check whether it is a standard date format and the data range are reasonable, and adjust the number format to correctly display the month.

Quick Links Check the File's AutoSave Status

To set up the repeating headers per page when Excel prints, use the "Top Title Row" feature. Specific steps: 1. Open the Excel file and click the "Page Layout" tab; 2. Click the "Print Title" button; 3. Select "Top Title Line" in the pop-up window and select the line to be repeated (such as line 1); 4. Click "OK" to complete the settings. Notes include: only visible effects when printing preview or actual printing, avoid selecting too many title lines to affect the display of the text, different worksheets need to be set separately, ExcelOnline does not support this function, requires local version, Mac version operation is similar, but the interface is slightly different.

The tutorial shows how to toggle light and dark mode in different Outlook applications, and how to keep a white reading pane in black theme. If you frequently work with your email late at night, Outlook dark mode can reduce eye strain and

It's common to want to take a screenshot on a PC. If you're not using a third-party tool, you can do it manually. The most obvious way is to Hit the Prt Sc button/or Print Scrn button (print screen key), which will grab the entire PC screen. You do

MicrosoftTeamsrecordingsarestoredinthecloud,typicallyinOneDriveorSharePoint.1.Recordingsusuallysavetotheinitiator’sOneDriveina“Recordings”folderunder“Content.”2.Forlargermeetingsorwebinars,filesmaygototheorganizer’sOneDriveoraSharePointsitelinkedtoaT

Finding the second largest value in Excel can be implemented by LARGE function. The formula is =LARGE(range,2), where range is the data area; if the maximum value appears repeatedly and all maximum values ??need to be excluded and the second maximum value is found, you can use the array formula =MAX(IF(rangeMAX(range),range)), and the old version of Excel needs to be executed by Ctrl Shift Enter; for users who are not familiar with formulas, you can also manually search by sorting the data in descending order and viewing the second cell, but this method will change the order of the original data. It is recommended to copy the data first and then operate.

TopulldatafromthewebintoExcelwithoutcoding,usePowerQueryforstructuredHTMLtablesbyenteringtheURLunderData>GetData>FromWebandselectingthedesiredtable;thismethodworksbestforstaticcontent.IfthesiteoffersXMLorJSONfeeds,importthemviaPowerQuerybyenter
