Customize how your Excel workbook is embedded

When you paste the embed code that you copied from the Excel Online page onto your web page, the frame on your web page displays what you configured on the Excel Online page. If you want to change the display on your web page after you paste the embed code, you can edit the HTML on your web page. For example, you can change dimensions of the frame, display only a specific part of the workbook, or provide capabilities, such as sorting or even typing in the workbook.

What do you want to do?


Allow interactivity

To see how this works, start with a simple modification: turn on interactivity for the embedded workbook.

In the markup, find the quotation marks that follow src, and then find this string: wdAllowInteractivity= False. Replace False with True so that the code resembles this:

&wdAllowInteractivity=True

If your workbook includes a PivotTable or a table that can be sorted and filtered, visitors to your web page can now sort, filter, and expand or collapse the data in the workbook.

 Note    You can use 0 and 1 for False and True, respectively.

Top of Page Top of Page

Allow typing

By default, no typing is allowed in the cells of your embedded workbook. If you want to allow typing, first turn on interactivity by setting AllowInteractivity to True, as explained above. Then, add the AllowTyping=True parameter within the src code. Your code now looks resembles this:

&AllowInteractivity=True&AllowTyping=True

Changes made in the cells of your embedded workbook are not saved in the original workbook. For example, if you create a simple mortgage calculator you may want to enable typing so that people can fill out the loan term, loan amount, and other variables.

 Note    You can use 0 and 1 for False and True, respectively.

Top of Page Top of Page

Display a specific item

If your workbook includes a chart, table, PivotTable, or named range and you want to display only that item in your web page, use the Item parameter to specify the item. For information about named ranges and named items in Excel workbooks see Define and use names in formulas.

For example, instead of displaying your whole workbook, you want to display only the chart named ScoreChart. You would add the Item=ScoreChart parameter to the src code. Your code would resemble this, assuming you are using the default value (False) for the AllowInteractivity parameter:

&Item=ScoreChart&AllowInteractivity=False

 Note    If the name includes special characters, write the special characters by using URL encoding. For example, to specify a table named P&LTable, you would write P%26LTable.

Top of Page Top of Page

Specify an active cell

If you want a specific cell to be active (selected) when the web page opens, you can specify it either by A1 notation or by name.

For example, if you wanted cell B4 to be highlighted you would add the ActiveCell=B4 parameter to the src code.

If the cell that you want highlighted is located on a worksheet other than the current worksheet, include the name of the worksheet in single quotation marks, with an exclamation mark between the sheet name and the cell reference. For example, if you wanted A1 on Sheet 2 to be the active cell your code would resemble this:

&ActiveCell=’Sheet2’!A1

 Note    You can specify both ActiveCell and Item to set the selection inside a named range. Setting the ActiveCell outside the specified Item parameter is not supported.

Top of Page Top of Page

Hide gridlines

For a clean look, you can hide worksheet gridlines. Add &wdHideGridlines=True to the src code (Or, &wdHideGridlines=1). If you change your mind, switch the parameter to False (or 0).

Top of Page Top of Page

Hide column headers

To hide column headers, add &wdHideHeaders=True to the src code. To display them, switch the parameter to False.

 Note    You can use 0 and 1 for False and True, respectively.

Top of Page Top of Page

Resize the frame

You can resize the frame that displays the workbook on your web page. Look for the values for width and height, near the end of the iframe tag. The values are pixels; default is 402 pixels wide by 346 pixels high.

For example, if you had a small chart to display on your blog, you could make the frame half its default size by specifying a width of 201 and height of 173. You code would resemble this:

<iframe width="201" height="173" frameborder="0" scrolling="no"

The frame includes elements that cannot be customized. The bottom bar cannot be removed, and, other than adding a Download button, its links cannot be modified.

Top of Page Top of Page

Add a Download button

If you want people to be able to download their own copy of the workbook, add a Download button, which appears on the bottom bar of the frame.

Dowload button

To include the Download button, add &wdDownloadButton=True to the src code. If you’d rather that people not download a copy, switch the parameter to False.

 Note    You can use 0 and 1 for False and True, respectively.

Top of Page Top of Page

 
 
Applies to:
Office 2013