Skip to main content

Open Excel

Opens an existing excel file or creates a new one.

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 node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

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

Input

  • Excel File Path - The full path of the excel file to open.

Output

  • Excel File Descriptor - The ID of the opened excel file.

Options

  • Create If Not Exists - Determines whether or not to create a new excel file if it does not exist.
  • Password - Encrypted Excel password

How It Works

  1. Validates Input: Checks that the file path is provided and not empty
  2. Checks File Type: Verifies the file extension (.xls, .xlsx, .xlsm, .xlam, .xltm, .xltx)
  3. Handles Legacy Format: If .xls file, converts it to .xlsx format automatically
  4. Processes Password: If credentials are provided, retrieves password from vault or uses provided password
  5. Opens File: Attempts to open the Excel file with or without password
  6. Creates If Missing: If file doesn't exist and Create If Not Exists is true, creates a new file
  7. Generates Descriptor: Creates a unique file descriptor for the opened Excel file
  8. Sets Active Sheet: Activates the first sheet at cell A1
  9. Returns Descriptor: Outputs the file descriptor for use in subsequent Excel operations

Requirements

  • A valid file path must be provided
  • The file must have a supported extension (.xls, .xlsx, .xlsm, .xlam, .xltm, .xltx)
  • For password-protected files, correct credentials must be provided
  • Read permissions are required for the file
  • If Create If Not Exists is false, the file must already exist

Error Handling

Error CodeDescriptionSolution
Core.Excel.Open.ErrOnCreateConfiguration parsing failedCheck node configuration is valid
Core.Excel.Open.ErrOnMessageMessage parsing failedVerify input message format
Core.Excel.Open.ErrPathFile path is emptyProvide a valid file path
Core.Excel.Open.ErrCredentialsInvalid credentials or vault configurationCheck password/vault settings are correct
Core.Excel.Open.ErrOpenFileFile doesn't exist, unrecognized extension, or file is corruptedVerify file exists and has valid extension
Core.Excel.OpenGeneral open errorCheck file permissions and format

Usage Examples

Example 1: Open Existing File

Open an Excel file for reading or modification:

- Open Excel:
- Excel File Path: "C:/Data/sales_report.xlsx"
- Create If Not Exists: false
-> fileDescriptor
- Get Range (fileDescriptor, "A1:C10") -> data
- Close Excel (fileDescriptor)

Example 2: Open or Create File

Open a file, creating it if it doesn't exist:

- Open Excel:
- Excel File Path: "Reports/monthly_report.xlsx"
- Create If Not Exists: true
-> reportFile
- Set Range (reportFile, "A1:B1", ["Month", "Sales"])
- Save Excel (reportFile)
- Close Excel (reportFile)

Example 3: Open Password-Protected File

Open an Excel file with password from vault:

- Open Excel:
- Excel File Path: "Confidential/secure_data.xlsx"
- Create If Not Exists: false
- Password: [Select from Vault]
-> secureFile
- Get Range (secureFile, "A1:Z100") -> sensitiveData
- Close Excel (secureFile)

Example 4: Process Legacy XLS File

Open and work with an old .xls format file:

- Open Excel:
- Excel File Path: "OldData/legacy_file.xls"
- Create If Not Exists: false
-> legacyFile
- Get Range (legacyFile, "A1:E50") -> oldData
- Create Excel -> newFile
- Set Range (newFile, "A1", {{oldData}})
- Save Excel (newFile, "ConvertedData/new_file.xlsx")
- Close Excel (legacyFile)
- Close Excel (newFile)

Usage Notes

  • The Open Excel node automatically converts .xls files to .xlsx format in memory
  • If Create If Not Exists is true and the file doesn't exist, a new blank Excel file is created
  • The file descriptor must be stored in a variable for use in subsequent Excel operations
  • The first sheet in the workbook is automatically activated at cell A1
  • Supported formats: .xls, .xlsx, .xlsm (macro-enabled), .xlam, .xltm, .xltx
  • For password-protected files, you can use vault credentials or provide password directly
  • The file remains open until explicitly closed with Close Excel node
  • Multiple files can be opened simultaneously with different descriptors

Tips

  • Always store the file descriptor in a variable for later use
  • Use Create If Not Exists: true for automated processes that may run before files are created
  • Close files as soon as you're done to free system resources
  • For password-protected files, use vault credentials instead of hardcoding passwords
  • When working with legacy .xls files, consider saving them as .xlsx for better compatibility
  • Check file exists before opening if Create If Not Exists is false to handle errors gracefully
  • Use absolute paths for reliability, or relative paths for portability
  • Remember that opening doesn't lock the file - other processes can still modify it