Display Excel Data On a Web Page

How to quickly display data from a Microsoft Excel spreadsheet to a webpage online

Display Excel data on website

At the company where I’m working we have a marketing calendar in MS Excel showing schedule for different marketing events and activities. The file is maintained by marketing and regularly updated with new speaking engagement opportunities or changes of venues to current events. And every time we updated it, we put a copy on a network or shared drive so that other people can access it. Later, we made it a little easier to access by putting a link to the Excel file on a web page.

The ways above might have worked in the past, but today when the workforce becomes more mobile and global, people want to see the spreadsheet content online with their smart phones [that don’t have Excel installed] or with their home computers [that may have Excel but with a lower version] whenever and wherever they want.

Display Excel data on a separate web page

To solve the problem, Excel has a simple but great functionality that is possibly overlooked by most users: save the spreadsheet as an HTML file (or HTM file in Excel language). The File > Save As functionality also outputs the excel tabs and charts! More information can be found on the Microsoft website.

All you need to do is to click File > Save As > Web Page (.htm). Excel will output an HTML file and a folder to hold the associated files/data. Push everything on the live server, then link to it from a web page, and your’re done.

Note: You have the options to Save As the whole workbook, or just one spreadsheet or just the printable area. Depending on what option you’ll use the file size will get bigger or smaller. For my stuff, I usually choose to Publish one sheet, and publish only the Printable area. Also, any additional format that you put on the Excel file will likely result in bigger file size such as merged cells, unnecessary bullets/format etc. For my stuff, I removed all the extra formatting when possible.

Click here to see an example of a spreadsheet saved as a web page. Don’t forget to check out the tab at the bottom.

Display Excel data on your current web page with iframe

As you can tell from the above demo, you can now see the Excel data online; however, the excel web page is a separate or stand-alone web page and doesn’t look like the rest of your site. What if you want to display the Excel data on a web page with your current website template — with the branding, logo, site navigation and everything?

Another simple solution, not perfect, but workable is to use iframe. If you don’t know what it is, get more information on W3school website. Iframe is just an HTML tag that let you hold and display information from a URL inside itself. Below is the same example above, but displayed directly on the web page.



Basically, you’ll need to add the following HTML code to your web page.

<iframe src=”http://www.yoursite.com/yourexcelfile.htm” height=”400px” width=”650px” frameborder=”0″></iframe>

Note: If your height and/or width is big enough, the corresponding scroll bar will become hidden.

Export Excel data as clean HTML, XML, JSON etc. (UPDATED 2017)

With the above Save As method the biggest shortcoming is that you have to use the code (or the file) that Excel created. Sometimes this works great, other times it doesn’t. A new challenge here is what if you don’t want to use the above method, but only want to extract or convert Excel data table into clean HTML, XML, JSON or other structured data format.

There’re softwares and tutorials out there that show you how to convert Excel data into other types. I, however, have a simple way of using Excel that let you do just this, and with my method you’re not limited to converting to only XML or JSON, but you can convert to almost anything you like. Stay tuned, it’s under way! Please add a comment so I know you’re interested.



Related Posts:




12 Responses to Display Excel Data On a Web Page

  1. Hi – Please post the update to show me how to convert excel to structured data as mentioned? I’m interested to know. I googled and knew there’re ways to accomplish it, but curious about how you’ll do it.

    • To respond to the question above (very late, I know), for those who come later and have similar question: if your Excel Workbook has more than one spreadsheets (more than one tabs), when performing a Save As, you’ll have the options to include the whole Workbook or just one Sheet or just the Selected/Printable Area. It’s all in there.

      With the example above, I included all Spreadsheets, and Excel generated the tabs in the HTML code automatically.

  2. Hey,

    I am trying to perform the above task, but my excel sheet doesn’t look in a tabular form on a webpage.

    Any help is appreciated.!!!

    Big thanks.

  3. Pretty useful tip. I had to do this once in the past and ended up creating an html version instead with the screen shots of charts and everything, pretty time consuming. This way seems much much faster.

Leave a Reply

Your email address will not be published. Required fields are marked *