Using Microsoft Excel Template

You can create a Microsoft Excel .xlsx email attachment using a Microsoft Excel template. 

The resulting Microsoft Excel document can include column headers and data cells containing:

Creating the Template

You can create a Microsoft Excel template file as described here.

Template Start Expression

We only support very simple Excel templates.

The first row in the Excel template can only contain column header values. 

The second row in the Excel template can only contain a Start expression, one or more cell data values, and an End expression. 

  1. The leftmost cell contains a Start expression immediately followed by a data value or Microsoft Excel worksheet formula.

  2. Intermediate cells contain data value or Microsoft Excel worksheet formulas.

  3. The rightmost cell contains a data value or Microsoft Excel worksheet formula immediately followed by an End expression.

The Start expression retrieves a set of rows from a table you specify. Each retrieved table row populates a row in the resulting Excel file. 

In the following example, the Start expression retrieves rows from the Customer table. The resulting Excel file contains one row for each customer who is 21 years of age or older.

Worksheet Formulas

Your template can include Excel worksheet formulas. In the following template, the Total column contains a worksheet formula which multiplies Price and Qty.


Cell Formatting

You can apply Excel formatting to the cells of the template. For example, the Price cell could be formatted as a Currency value.

Multi-Worksheet Workbooks

Your Excel workbook template can contain one or more worksheets each of which is a template. The resulting ,xlsx file will contain each of these worksheets.

Viewing or Editing the Template

Once the template is created, click the View button to view the template.

The View button does not work well for editing Microsoft Excel templates because of built-in limitations in the way Microsoft Excel files can be opened and edited from the web. Instead, login to your data source and edit the Microsoft Excel template file there.


  1. Excel tables are not supported. Templates must be simple worksheets.

  2. Excel pivot tables are not supported.

  3. Nested tables cannot be displayed in the same Excel worksheet. For example, you cannot display each Order record followed its child Order Detail records.


You may see the following Excel error message when you attempt to open the resulting Excel .xlsx file.

Excel cannot open the file <filename.xlsx> because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

This error can occur if you use a Google Docs template file rather than a Excel template file. If you inadvertently use a Google Docs template file, the output is an HTML file that may look like a Excel worksheet but it will not be a valid Excel .xlsx file.

To create a valid Excel template file, set the HTTP Content Type to "XLSX" and click the Create button following the template. This will create a valid Excel template file which you can then customize.

Did this answer your question?