Blogroll

Here are a few interesting posts related to embedding Excel on web pages:

  • Crabby Office Lady shows an example of a┬ávery nice dynamic mortgage calculator.
  • Groovy Post has a very detailed step by step on uploading Excel files to SkyDrive and then sharing and embedding them in html
  • Spreadsheet Templates adds their own detailed how to guide
  • Last but not least, a very cool demo with interactivity from Microsoft.com

Time-dependent information in an Excel web page

In one of the WordPress forums there was a question about displaying the list of pharmacies that are on duty today, given a list of all the pharmacies in an area and when each of them is on duty. I’ve decided to give it a try below. Note how the list will change if you come back to this site some other day.

Here is how the workbook works. On the second sheet, there is a table with a list of pharmacies, their address, and when they are on duty. I have added a calculated column, that determines if they are on duty today (by using the =TODAY() function). Then, I have other columns that calculate, for rows that are “on duty”, their index on the list. On the first sheet, I show (by using =VLOOKUP()) only those rows that are on duty today.

Related posts:

How to: insert workbook in WordPress

While embedding Excel on a web page is pretty easy, doing it in WordPress.com is a little tricky.

The problem: Excel Web App embedding is done using an iframe, and WordPress.com strips out iframes for security reasons, except from sites that are whitelisted.

The solution (which you can do even w/o understanding the problem :-)) is below.

  1. While editing the post, switch to HTML mode
  2. Paste the HTML markup you got from the file in http://office.live.com
  3. Click Save Draft

Once you’ve saved the draft, you can continue working as you usually do, preview the post, continue editing it, publish it, etc. The important thing is to save the draft immediately after pasting the HTML code. Otherwise, WordPress will strip it out.

Doing “Save Draft” changes the iframe code to a different code, that is not stripped out by WordPress. For example:

<iframe src=”http://r.office.microsoft.com/r/rlidExcelEmbed?su=89268436867536320&Fi=SD13D252B9D24D5C0!111&AllowInteractivity=False&#8221; width=”402″ height=”346″ frameborder=”0″ scrolling=”no”>

Is replaced by:
[office src=”http://r.office.microsoft.com/r/rlidExcelEmbed?su=89268436867536320&Fi=SD13D252B9D24D5C0!111&AllowInteractivity=False&#8221; width=”402″ height=”346″]

Notes:

First of all, the trick above and the notes below are based on my own experience and trial and error. I couldn’t find any official documentation for this. If you have experienced anything else, of have more information, please enter a comment.

As far as I can tell, this issue (and workaround) is only relevant for WordPress.com. Self-hosted WordPress seems not to strip iframe so it doesn’t exhibit this issue.

Using Windows Live Writer to post to your WordPress.com blog also seems to work just fine.