File Format & Compatibility

Fix Excel Published HTML Showing Source Code on OneDrive

Muhammad TalhaMuhammad Talha Nov 2, 2026 869 views

Question details

The user is experiencing an issue where an Excel workbook published as an HTML file displays raw HTML source code instead of the rendered spreadsheet when stored or opened via OneDrive.

How to Fix Excel Published HTML Showing Source Code on OneDrive
Product
Microsoft Excel, OneDrive
Device & OS
not provided
Scenario
Opening or embedding an Excel-published HTML file hosted on OneDrive in a web browser.
Observed behavior
Newly uploaded HTML files display as raw HTML text in the browser, whereas local copies and older HTML files uploaded previously to OneDrive render the workbook correctly.
Before you start

Ensure you have both the main HTML file and its associated support folder saved locally on your computer, as both are required for the web page to render correctly.

Solution 1Recommended

Verify Local Files and Upload the Complete HTML Package

Ensure the published HTML file works locally and that all necessary support files are uploaded to OneDrive to prevent rendering errors.

When Excel publishes a workbook to HTML, it typically generates a primary HTML file and a separate folder containing vital scripts, styles, and images. Missing this folder can cause display issues.

Additionally, verifying the file locally confirms that the export process was successful and isolates the problem to OneDrive's handling of the file.

1
Save published HTML locally

Publish your Excel workbook to HTML and save it directly to a local folder on your computer's hard drive.

2
Test the local copy

Double-click the local .htm or .html file to open it in your default web browser. Confirm that the workbook displays correctly instead of showing source code.

3
Upload the complete package

Log into OneDrive and manually upload both the main HTML file and the corresponding support folder (e.g., filename_files) into the same directory.

4
Test the OneDrive link

Generate a sharing link from OneDrive and open it in an incognito or private browsing window to verify the file rendering.

OneDrive Security Updates: Recent security changes in OneDrive may affect how active HTML content is handled in the browser, sometimes forcing files to display as plain text.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Sharing

If you are struggling with Excel's HTML publishing features and OneDrive's rendering issues, WPS Office offers a free, lightweight, and highly compatible alternative. You can effortlessly create, edit, and share spreadsheets online via secure links without worrying about complex HTML embedding issues.

  1. 1. Install WPS Office: Download and install the free WPS Office suite on your computer or mobile device.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheet and seamlessly open your existing .xlsx or .xls file.
  3. 3. Share via Secure Link: Click the 'Share' button in the top right corner to generate a direct, viewable web link without needing to publish or troubleshoot HTML files.
Highly compatible with Microsoft Excel (.xlsx, .xls) formats without formatting loss.Built-in cloud sharing features to distribute spreadsheets via secure, viewable links.Familiar user interface that requires zero learning curve.Lightweight and completely free to install on multiple devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Excel HTML file show code on OneDrive but not locally?

Cloud storage platforms like OneDrive frequently update their security measures. To prevent malicious scripts from executing, OneDrive may treat newly uploaded HTML files as plain text, causing the browser to display the raw source code instead of rendering the web page.

Do I need to upload the support folder when publishing Excel to HTML?

Yes. When Excel publishes a workbook as a webpage, it creates a main HTML file and an associated support folder containing images, formatting, and scripts. Both must be uploaded to the exact same directory for the page to display properly.

Can I embed an Excel file on a webpage without publishing it as HTML?

Yes. Instead of manually publishing to HTML, you can use Excel for the Web to generate a direct embed code snippet (iframe) from the sharing settings. This method relies on Microsoft's built-in viewer and is often much more reliable than hosting raw HTML files.