Office Excel Macro

The Office Excel macro displays the content of an Excel spreadsheet on a wiki page. First attach the spreadsheet to a Confluence page, then use the macro to display the content. When viewing the page, people will see the content of the spreadsheet, without needing to have Office installed.

For details, see the View File Macro.

Code examples

The following examples are provided for advanced users who want to inspect or edit the underlying markup for a Confluence page. 

Macro name: viewxls

Macro body: None.

Parameter name Required Default Parameter description and accepted values
name Yes (None.)

The file name of the Excel spreadsheet to be displayed. The document must be attached to a page on your Confluence site.

page No The page containing the macro The name of a Confluence page to which the Excel spreadsheet is attached.
col No Last column with content

The number of the last column you want displayed, starting from '0' as the first column.

Hint for reducing the size of the spreadsheet: Use the col and row parameters to reduce the size of the spreadsheet displayed on the wiki page. This is especially useful to prevent the display from showing empty cells. This will also help to prevent 'out of memory' errors.

row No Last row with content The number of the last row you want displayed, starting from '0' as the first row.
grid No true

Determines whether the macro will show borders around the cells in the spreadsheet.

Accepted values:

  • true – Shows borders.
  • false – Does not show borders.
sheet No The most-recently viewed worksheet The name of the worksheet that you want displayed.

Storage format example

<ac:structured-macro ac:name="viewxls">
  <ac:parameter ac:name="col">E</ac:parameter>
  <ac:parameter ac:name="name">
    <ri:attachment ri:filename="Spreadsheet.xls"/>
  <ac:parameter ac:name="sheet">Sheet1</ac:parameter>
  <ac:parameter ac:name="row">5</ac:parameter>

Wiki markup example

{viewxls:col=5|page=Docs|name=My document.xls|grid=false|sheet=mysheet|row=5}

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport