Excel
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Lists,Tokens
The Excel add-on adds actions that create Excel files and read Excel and CSV files. They write a list, a SQL query result or CSV text to an .xlsx file, read the sheet names of a workbook, and load a sheet or a CSV source into a list.
These actions are part of the Excel add-on (DnnSharp.Excel). The add-on is installed separately and needs the EXGEN feature in your license. If it isn't licensed, the actions fail. If you don't see the actions, the add-on isn't installed. The actions that create files are in the Documents group, and the actions that create lists are in the Lists & Objects group.
Choosing an action
| Action | What it does | Use it to |
|---|---|---|
| Create Excel from SQL query | Runs a query and writes the result straight to an .xlsx file, without a list. | Export a large table or report query. |
| Create Excel from List | Writes the items of a list to an .xlsx file, with the columns you choose. | Export the rows of a listing, with optional formulas. |
| Create Excel from CSV Text | Turns CSV text from a token or typed in the action into an .xlsx file. | Convert CSV returned by an API into a workbook. |
| Get Excel Sheet Names | Saves the sheet names of an .xlsx file as comma-separated text and as a JSON array. | Check that an uploaded file has the sheet you expect before importing it. |
| Create List from Excel (.xlsx) | Reads one sheet of an .xlsx file into a list. You can pick the columns, sheet and rows. | Import a spreadsheet that a user uploads. |
| Create List from a CSV source | Reads CSV text or a CSV file into a list, one entry per row. | Import an uploaded CSV file, or CSV text from a field or an API. |
| Create List from CSV file (Obsolete) | The older, file-only version of Create List from a CSV source. | Nothing new. Use Create List from a CSV source instead. |
Creating Excel files
The three Create Excel actions save the file in a portal folder you choose, and return its URL, path or a download link in tokens. They don't send the file to the browser. Use Redirect to URL with the LinkClick URL token, or attach the file with Send Email.
- One plain sheet. The workbook has one sheet, named
Sheet1. You can protect the file, the sheet or both with a password. - Missing folders are created.
- Files with the same name. Handle Duplicates is
Renameby default, which adds a unique suffix. Set it toOverwriteto replace the file. Each run otherwise creates a new file, so clean up old ones, for example with Delete File. .xlsxis added for you. Don't add it to the file name, or the file ends up asname.xlsx.xlsx.- Allowed file extensions. DNN only saves file types that are allowed on the site. Create Excel from List and Create Excel from CSV Text add
xlsxto the allowed list for you. Create Excel from SQL query doesn't.
For large query results, use Create Excel from SQL query. The rows go straight from the database into the file, without a list.
Reading Excel and CSV files
Create List from Excel (.xlsx) and Create List from a CSV source load the rows of a file into a list. You can then go through the list with Execute Actions for each List Entry, save it with Import List into Database, or use it with the other Lists Objects actions.
- The file must already be on the site, for example uploaded through a form or created by another action.
- Pick the sheet first. Get Excel Sheet Names tells you which sheets a workbook has.
- Values are text. Unlike lists from SQL, lists from Excel and CSV hold text values.
- An existing list name. If the list already exists, the new rows are added to its end.
.xlsxonly. Older.xlsfiles and password-protected workbooks can't be read.
To write a list as CSV, use Create CSV from List in the core Documents actions. Create Excel from CSV Text can then turn that CSV into a workbook.
For PDF and Word files, see the PDF Generator and Word add-ons. For all add-ons, see Add-ons.
Revised 10/02/2026