If you want to embed or publish Excel data to web pages, there are many solutions. Excel 2013 does fancy things with skydrive to share data, and there are plenty of activeX plugins and so on that do the same. Here’s a my way to create a simple web page that you either load directly on a web site, or send to someone.

There are two output options
  • A static web page
  • An interactive google Visualization table
You will need the libraries in the cDataSet.xlsm workbook – you can download them here. If you already use cDataSet this is a perfect companion.

An example

For the purposes of this article, I wanted to create a few tables to embed or link to in this page. A massive one, a cut down version of the same thing, and a small data table. I wanted to show how to pass cell styles as well as data from Excel and do examples of both Google Interactive visualizations and Static tables.
Here’s  the code I needed to create the 5 versions.
Private Function makeSomeTables()
    Dim styles As String

    styles = "color,background-color,font-size"

    tableToHtml "colorTable", , , styles, "google"
    tableToHtml "colorTable", , 20, styles, "google"
    tableToHtml "colorTable", , 20, styles, "static"
    tableToHtml "inputData", , , , "static"
    tableToHtml "inputData"
End Function

The results

tableToHtml “colorTable”, , , styles, “google”
The first one is a google visualization table of the entire color reference table I used in Color Fiesta. This is a lookup table of various color cross references, such as Pantone codes, dulux paint colors, html colors and so on. Since it is very large, and growing,  I’m not embedding it, but you can link to it here.
tableToHtml “colorTable”, , 20, styles, “google”
Next is a cut down version of the first.

tableToHtml “colorTable”, , 20, styles, “static”
Then, the same thing, but as a static table

tableToHtml “inputData”, , , , “static”
Moving on to different data, in this case the test data for How to use the Excel Roadmapper, here’s a static version, without any styles being inherited from Excel

tableToHtml “inputData”
And finally, the same data but expressed as a google visualization. This is the default behavior


The Code

This is really a mashup of many topics covered elsewhere on this site, but here is the main function. The rest of the code in usefulHtmlConverters module of cDataSet.xlsm.

Call information

Here’s how to call the functions in usefulHtmlConverters.
To find out how to
The Html file is displayed below or can be accessed  here

For help and more information join our community,  follow the blog or  follow me on Twitter