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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: