Skip to main content

Create Excel

Creates a new excel file

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing the node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Input

  • Excel File Path - Path of the new excel file to create.

Output

  • Excel File Descriptor - Created excel file descriptor id.

Options

  • Overwrite If Exists - Overwrites the existing file if the file path already exists.

How It Works

  1. Validates Input: Checks that the file path is provided and not empty
  2. Checks Existence: Verifies if a file already exists at the specified path
  3. Handles Overwrite: If the file exists and Overwrite If Exists is enabled, deletes the existing file; otherwise returns an error
  4. Creates File: Creates a new Excel file using the excelize library
  5. Generates Descriptor: Creates a unique file descriptor for the new Excel file
  6. Saves File: Saves the new Excel file to the specified path
  7. Sets Active Sheet: Activates the default sheet (usually "Sheet1")
  8. Returns Descriptor: Outputs the file descriptor for use in subsequent Excel operations

Requirements

  • A valid file path must be provided (can be absolute or relative)
  • The directory where the file will be created must exist
  • Write permissions are required for the target directory
  • If a file exists at the path and Overwrite If Exists is false, the operation will fail

Error Handling

Error CodeDescriptionSolution
Core.Excel.Create.ErrOnCreateConfiguration parsing failedCheck node configuration is valid
Core.Excel.Create.OnMessageMessage parsing failedVerify input message format
Core.Excel.Create.ErrCreateExcelFilePath is emptyProvide a valid file path
Excel.Create.ErrCreateExcelFileFile already existsEnable Overwrite If Exists or use a different path
Excel CreateExcel.ErrCreateExcelFileFailed to save fileCheck directory exists and write permissions

Usage Examples

Example 1: Create a New Report

Create a new Excel file for daily reporting:

- Create Excel:
- Excel File Path: "C:/Reports/daily_report.xlsx"
- Overwrite If Exists: true
-> fileDescriptor
- Create Sheet (fileDescriptor, "Summary")
- Set Range (fileDescriptor, "A1:C1", ["Date", "Sales", "Revenue"])
- Save Excel (fileDescriptor)
- Close Excel (fileDescriptor)

Example 2: Dynamic File Creation

Create files with dynamic names based on current date:

- Get Current Date -> currentDate
- Format Date (currentDate, "yyyy-MM-dd") -> dateStr
- Create Excel:
- Excel File Path: "Reports/report_{{dateStr}}.xlsx"
- Overwrite If Exists: false
-> reportFile
- Set Cell Value (reportFile, "A1", "Report for {{dateStr}}")
- Save Excel (reportFile)
- Close Excel (reportFile)

Example 3: Automated Data Export

Export processed data to a new Excel file:

- HTTP Request (API endpoint) -> apiData
- Transform Data (apiData) -> processedData
- Create Excel:
- Excel File Path: "exports/data_export.xlsx"
- Overwrite If Exists: true
-> exportFile
- Set Range (exportFile, "A1", {{processedData}})
- Save Excel (exportFile)
- Close Excel (exportFile)

Usage Notes

  • The created Excel file includes one default sheet (usually named "Sheet1")
  • The file is saved immediately upon creation, so it exists on disk right away
  • The file descriptor returned is required for all subsequent Excel operations on this file
  • If Overwrite If Exists is false and the file exists, an error will be thrown
  • The file path can be absolute (C:/path/file.xlsx) or relative (./file.xlsx)
  • Supported file extensions are .xlsx and .xls
  • The file is created in memory and then saved to disk
  • You must call Close Excel when done to release resources

Tips

  • Use Overwrite If Exists: true for automated processes that run on schedules
  • Include timestamps in file names to avoid conflicts (e.g., "report_2025-01-15_143000.xlsx")
  • Ensure the target directory exists before creating the file
  • Store the file descriptor in a variable for use throughout your workflow
  • Always close the file when done to prevent resource leaks
  • Consider using relative paths for portability across environments
  • Create files in a temporary directory first, then move them to final location if needed