How to: insert workbook in WordPress

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

The problem: Excel Web App embedding is done using an iframe, and 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
  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=”!111&AllowInteractivity=False&#8221; width=”402″ height=”346″ frameborder=”0″ scrolling=”no”>

Is replaced by:
[office src=”!111&AllowInteractivity=False&#8221; width=”402″ height=”346″]


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 Self-hosted WordPress seems not to strip iframe so it doesn’t exhibit this issue.

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


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: