Excel file generator

This article outlines how to use the Excel Generator add-on, its properties, and how to generate Excel outputs from your Squirrel365 projects.

circle-info

Note: The Excel Generator add-on is currently not publicly available on the Squirrel Marketplace. If you're interested, or would like more information, please get in touch.

The Excel Generator add-on lets you produce dynamic Excel (.xlsx) outputs directly from your published Squirrel365 apps. You design a template in Microsoft Excel, upload it to the Squirrel Cloud, and map ranges in the template to data in your Squirrel spreadsheet. When an end user clicks the generate button, the add-on injects live data into the template and downloads the finished file — all in real time, with no data stored on the server.


Creating your Excel template

The add-on works by taking a pre-designed Excel workbook and injecting data from your Squirrel365 project into specific cell ranges at runtime.

Your template is where you control the output's structure, styling, branding, and any static content (headings, labels, formatting, logos, and so on). Everything outside the ranges you define as replacements is preserved exactly as it appears in the template.

Unlike the PDF & PowerPoint Generator, the Excel Generator does not use {{placeholder}} syntax. Instead, you define replacements by specifying target cell ranges in the template and mapping them to data ranges in your Squirrel spreadsheet. This means your template is simply a well-designed Excel file — ready to receive data in the areas you specify.

A few things to keep in mind when designing your template:

  • Structure your sheets clearly. Think about which sheets the output needs, where the data will land, and where static content (headers, labels, branding) should sit.

  • Format the target ranges. Any formatting you apply to the target cells in the template (number formats, fonts, colours, borders, conditional formatting) will be preserved in the output. Style it how you want the final document to look.

  • Keep it tidy. If certain sheets in the template are only used for working calculations or staging data, you can remove them from the output using the Remove Sheets feature (covered below).


Uploading your Excel template to the Squirrel Cloud

For the add-on to connect to your template and generate an output, you'll need to upload your Excel file to the Squirrel Cloud.

  1. Navigate to the External Documents tab on the left-side panel.

  2. Select Add New File in the top-left corner and upload your Excel (.xlsx) file.

Once uploaded, you'll be taken to the template detail page.

  1. Click Back at the top-left corner to return to the main External Documents page.

Here you'll see two keys — the API key and the GUID key. These allow the add-on to connect to your uploaded template.

circle-exclamation

Connecting the add-on to the template

  1. In the Squirrel365 designer, place the Excel Generator add-on on the canvas. You'll find it under the Add-ons menu on the left-hand panel.

  2. Under the GENERAL properties, you'll see the following fields:

  • Squirrel API Key — paste the API key from your External Documents page.

  • Document GUID — paste the GUID key from your External Documents page.

  • Generated filename — this will be the name of the downloaded file. This property can be bound to a cell in the spreadsheet.

  • Status message — (optional) bind this to a cell in the spreadsheet to receive progress updates and error messages during generation.

circle-info

Tip: You can put both keys in your Squirrel spreadsheet and bind the properties to those cells. That way, if you ever need to update them, you can simply change the values in the spreadsheet without having to find the add-on component.


Connecting the replacement data

The core of the Excel Generator is mapping data from your Squirrel spreadsheet into specific cell ranges in the template. This is done through Range Replacements.

How range replacements work

Rather than using placeholder syntax, the Excel Generator works with a direct range-to-range mapping:

  • You define a target range in the template (a sheet name and a cell range, e.g. Sheet1, C6:E24).

  • You map it to a value range in the Squirrel spreadsheet that contains the data to inject (e.g. Data!J8:L26).

At generation time, the add-on takes the data from the Squirrel spreadsheet range and writes it into the corresponding range in the template. Everything else in the template remains untouched.

Setting up a range replacement

Under the RANGE REPLACEMENTS section in the properties panel, you can add one or more cell range mappings.

For each range replacement, configure the following:

  • Name — a friendly label for your own reference (e.g. "Revenue Data", "Summary Table"). This doesn't affect the output — it's just to help you stay organised.

  • Sheet name — the name of the sheet in the Excel template where the data should be injected (e.g. Sheet1).

  • From — the starting cell of the target range in the template (e.g. C6).

  • To — the ending cell of the target range in the template (e.g. E24).

  • Value — the cell or range in the Squirrel spreadsheet that contains the data to inject (e.g. Data!J8:L26). This can be bound to the spreadsheet using the cell-binding icon.

To add more range replacements, click the + button at the top of the Cell Ranges list. Each mapping appears as a named item in the list, and you can select any item to view or edit its properties.

circle-info

Tip: For a single cell replacement, set the From and To fields to the same cell (e.g. From: A1, To: A1).

What happens if the ranges don't match in size?

The Squirrel spreadsheet range and the template target range don't need to be exactly the same size. Here's how mismatches are handled:

  • If the Squirrel data range is larger than the target range — the data is truncated to fit. Only the data that falls within the target range dimensions will appear in the output.

  • If the Squirrel data range is smaller than the target range — the cells in the target range that don't receive new data remain unchanged. Whatever was already in those cells in the template will stay in the output.

This is worth keeping in mind when designing your template. If you want a clean output, make sure the target range either matches your expected data size or that any "leftover" cells in the template contain appropriate default values (or are left empty).

Use the correct value format

For data to appear correctly in the output, replacement values must be in Text format. Any value formatted as currency, percentage, date/time, or similar will lose its formatting and return as a raw number if not converted to text first.

We recommend using the TEXT() formula to reference any value that will be mapped to a range replacement. For example:

  • $3.50 in cell A1 of the Sheet 1 sheet

  • TEXT('Sheet 1'!A1, "$#.00") in cell B2 of your output values sheet

This preserves the display formatting while ensuring the value is read as text by the generator.

If this step is missed, values could come through as raw numbers — losing currency symbols, percentage signs, or date formatting.

Best practice: create a dedicated output sheet

As a tip, we recommend creating a new sheet in your Squirrel spreadsheet specifically for the output values. This keeps everything organised in one place and makes it easier to manage your range mappings.

  1. Create a new sheet and label it clearly (e.g. "ExcelOutputValues").

  2. Use this sheet to gather and format all the values that will be mapped to your template ranges.

  3. Section the values according to the associated areas in your template to keep things easy to track.


Removing sheets from the output

The Excel Generator can remove specific sheets from the output. This is useful when your template contains sheets that are only needed for structure or staging, and shouldn't appear in the final downloaded file.

Under the REMOVE SHEETS section in the properties panel:

  • Enter a comma-separated list of sheet names to exclude from the output (e.g. sheet1, A New Sheet).

  • This property can be bound to a cell in the spreadsheet for dynamic control — for example, a cell containing a concatenated list of sheet names to remove based on previous inputs in the app.

circle-info

Note: Unlike the PowerPoint PDF Generator (which uses slide numbers), the Excel Generator uses sheet names to identify which sheets to remove. Make sure the names match exactly, including any spaces.


Styling the component

As with all components in Squirrel365, the Excel Generator button can be styled to match your project or branding. The styling properties are identical to those of the PDF & PowerPoint Generator.

General styling

  • Generate XLSX text — the default text displayed on the button before interaction. This property can be bound to the spreadsheet.

  • Generating XLSX text — the text displayed on the button while the document is being generated. This property can be bound to the spreadsheet.

Font

  • Font — choose a font style from the dropdown list.

  • Size — change the font size using the spinner buttons, by typing a value, or by binding to a spreadsheet cell.

  • B / I / U — toggle bold, italic, and underline formatting for the button text.

  • Text Colour — set the colour of the button text.

  • Opacity — adjust the transparency of the button text.

  • Text Alignment — align the text to the left, right, or centre.

  • Capitalisation — change the letter case to uppercase first letter, all uppercase, or all lowercase. Deselecting all options returns the text to its original case.

Border

  • Border weight — adjusts the weight of the component border. This can be bound to the spreadsheet.

  • Border radius — applies corner rounding to the component border. This can be bound to the spreadsheet.

Default state

Each of these properties needs to be checked to take effect.

  • Button Colour — adjusts the default button colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the default button opacity. This can be bound to the spreadsheet.

  • Border Colour — adjusts the default border colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the default border opacity. This can be bound to the spreadsheet.

Hover state

Each of these properties needs to be checked to take effect. These can be disabled to inherit from the default styling options above.

  • Button Colour — adjusts the hover state button colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the hover state button opacity. This can be bound to the spreadsheet.

  • Border Colour — adjusts the hover state border colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the hover state border opacity. This can be bound to the spreadsheet.

  • Font Colour — adjusts the hover state text colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the hover state text colour opacity. This can be bound to the spreadsheet.

Pressed state

Each of these properties needs to be checked to take effect. These can be disabled to inherit from the default styling options above.

  • Button Colour — adjusts the pressed state button colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the pressed state button opacity. This can be bound to the spreadsheet.

  • Border Colour — adjusts the pressed state border colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the pressed state border opacity. This can be bound to the spreadsheet.

  • Font Colour — adjusts the pressed state text colour. This can be bound to the spreadsheet.

    • Opacity — adjusts the pressed state text colour opacity. This can be bound to the spreadsheet.

circle-info

Note: This guide does not cover the dynamic visibility properties, as these are common to all visible components. A separate guide on dynamic visibility can be found herearrow-up-right.

Last updated

Was this helpful?