Fix OneDrive Security Warnings and Power Query URL Errors in Excel
Question details
The user is experiencing security warnings when opening files downloaded from OneDrive, as well as encountering HTML errors in Power Query when attempting to connect to a OneDrive web URL.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Connecting to a OneDrive file via Power Query using a web URL or opening a OneDrive workbook in Excel.
- Observed behavior
- Excel triggers security checks and warnings for files from the internet, while Power Query fails to connect properly, returning HTML data instead of the workbook's tables due to missing authentication or an incorrect URL format.
Verify that your Microsoft 365 installation is fully up to date and that you have your Microsoft organizational or personal account credentials ready for authentication.
Update Microsoft 365 and Check Security Settings
Resolve persistent internet file security warnings by keeping Excel updated and maintaining safe macro configurations.
Excel performs strict security checks on files originating from the Internet, including OneDrive links. Ensuring your client is updated minimizes false-positive warnings.
Open Excel and navigate to File > Account. Click on 'Update Options' and select 'Update Now' to ensure the latest security definitions and patches are applied.
Go to File > Options > Trust Center and click 'Trust Center Settings'. Ensure that you do not enable all macros or unrestricted VBA access, as this drastically reduces your system's security. Set it to 'Disable all macros with notification'.
Correct the OneDrive URL for Power Query
Fix the issue where Power Query returns HTML instead of workbook data by bypassing the web viewer and using a direct file path.
Consult the Power Query Community Forum
For complex or enterprise-specific authentication issues that persist, specialized Microsoft Fabric Community support is recommended.
Try WPS Office for Seamless Spreadsheet Management
If you want to avoid complicated web URL authentication errors, complex security warnings, and macro troubleshooting, WPS Office offers a highly compatible and lightweight alternative for your daily spreadsheet and data processing needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the software: Run the installer and follow the simple on-screen instructions to set up the office suite.
- 3. Open your data files: Launch WPS Spreadsheets and open your existing data files directly with complete formatting and formula retention.

Frequently Asked Questions
Why does Power Query return an HTML table instead of my OneDrive Excel data?
This happens when Power Query connects to the OneDrive web viewer URL instead of the direct data file, or when authentication is missing. To fix this, copy the path from the Excel desktop app via File > Info, and ensure you delete the '?web=1' parameter before connecting.
Should I enable all macros to bypass Excel security warnings for downloaded files?
No, enabling all macros or unrestricted VBA access is highly discouraged because it significantly reduces your computer's security against potentially malicious scripts. Keep your settings at 'Disable all macros with notification'.
How do I correctly authenticate a OneDrive file in Power Query?
When connecting to the cleaned URL (without the ?web=1 parameter), select the 'Organizational account' tab in the authentication window and sign in using your Microsoft 365 credentials to grant the query access to the protected data.




