How to Automatically Retrieve and Refresh Treasury Rates in Excel
Question details
The user wants to automate the process of fetching and updating current Treasury interest rates from a website into an Excel workbook.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Tracking daily interest rates by connecting a workbook directly to a web-based XML data source.
- Observed behavior
- The goal is to establish a connection that automatically updates the data upon opening the file, eliminating the need for manual copy-pasting.
Ensure you have a stable internet connection and the direct URL or XML link to the Treasury interest rates website before setting up the data connection.
Use Power Query to Connect and Refresh Data
Power Query allows you to link directly to a web source and set the data to refresh automatically whenever the workbook is opened.
By utilizing Power Query, Excel creates a live bridge to the Treasury website's XML feed. This avoids the repetitive and error-prone process of manually copying and pasting daily interest rates.
Open your Excel workbook, go to the 'Data' tab on the ribbon, and click 'Get Data' > 'From Other Sources' > 'From Web'.
Paste the URL of the Treasury interest rates XML data source into the dialog box and click 'OK'.
In the Navigator window, select the relevant data table or XML node that contains the rates, then click 'Load' to import it into your worksheet.
Click anywhere inside the imported data table, go to the 'Table Design' or 'Query' tab, click 'Properties', and check the box for 'Refresh data when opening the file'. Click 'OK'.

Import and Manage Web Data Easily in WPS Spreadsheets
WPS Spreadsheets offers robust data import tools, allowing you to pull information from web pages seamlessly. It provides a lightweight, fast, and highly compatible environment for your daily data tracking needs without complicated setups.
- 1. Access Data Tools: Open WPS Spreadsheets, navigate to the worksheet where you want the data, and click on the 'Data' tab in the top menu.
- 2. Select Web Import: Click on 'Import Data' and choose the 'Import Data from Web' option from the dropdown menu.
- 3. Connect to the Source: Paste the web address of your Treasury data source into the address bar of the prompt and click 'Import'.
- 4. Refresh Data: To update the rates in the future, simply navigate to the 'Data' tab and click 'Refresh All' to pull the latest information.

Frequently Asked Questions
Why isn't my Power Query data refreshing automatically?
Auto-refresh must be explicitly enabled. Right-click your data table, select 'Data Range Properties' or 'Connection Properties', and ensure 'Refresh data when opening the file' is checked.
Can I refresh the Treasury rates data without closing and reopening the file?
Yes, you can manually refresh the data at any time by navigating to the 'Data' tab and clicking the 'Refresh All' button on the ribbon.
Does the web data source need to be in XML format?
While XML is highly structured and ideal for data extraction, Power Query can also successfully extract data tables from standard HTML web pages, CSV files, or JSON feeds.
What happens if the Treasury website changes its URL?
If the source URL changes, your query will fail to refresh and return an error. You will need to open the Power Query Editor, go to 'Source' in the Applied Steps pane, and update the URL to the new address.




