Excel Cell Updater

This node updates cells in an existing Excel spreadsheet. The cell addresses and their new content are supplied by an input data table.

Adding additional table input ports allows to update multiple spreadsheets in the same file.

The node supports two file formats chosen by file extension:

  • .xls format: This is the file format which was used by default up until Excel 2003. The maximum number of columns held by a spreadsheet of this format is 256 (address IV) and the maximum number of rows is 65536.
  • .xlsx format: The Office Open XML format is the file format used by default from Excel 2007 onwards. The maximum number of columns held by a spreadsheet of this format is 16384 (address XFD) and the maximum number of rows is 1048576.

Each input table must have one column which contains the addresses of the sheet cells which should be updated. This column has to have a string-compatible type. Two types of addresses are supported and can be used interchangeably:

  • Excel cell addresses, e.g. "A5", "E96" or "OZ23914"
  • Number addresses separated by a colon ":" with the first number being the number of the column and the second the one of the row. Both start counting with 1. You can use the COLUMN() function in Excel or enable Excel's R1C1 reference style to get the column number. Examples: "1:5", "5:96" or "413:23914"

The remaining columns contain the replacement values for the specified cells. A replacement value should appear in at most one column per row and the remaining cells should be left empty (i.e. only contain missing values). The column type should be the same as the (desired) column type in the updated sheet. If all cells in a row but the cell address contain missing values, the replacement value is a blank cell or the string specified in the “Replace missing values by” field.

The formatting of existing cells, rows and columns in the Excel sheet will be preserved.

In the following table ? stands for a missing value. This example table would write the string "Ok" to Excel cell A5 and the number 50 to cell E96 (in number address style). The cell OZ23914 will be cleared if no alternate missing value is defined.

Address String Integer
A5 Ok ?
5:96 ? 50
OZ23914 ? ?

This node can access a variety of different file systems. More information about file handling in KNIME can be found in the official File Handling Guide.

Options

Input file
Select the Excel file (.xls or .xlsx) to read from and update. The file system can be a local file system, a mountpoint, or a file system connected via an input port.
Password to protect files
Allows you to specify a password to protect the output file with. In case the "append" option is selected and the file already exists, the password must be valid for the existing file.
  • None: Only files without password protection can be updated.
  • Credentials: Use a password set via workflow credentials.
  • Password: Specify a password.
Workflow credentials
Select the workflow credentials to use.
Password
Enter the password to protect the file.
Create a new file
If selected, a copy of the original file is created and updated instead of the original file. The newly created file must have the same file type as the original file.
Output file
Provide the path to the new file that should be created as a copy of the original file. The output file must have the same file type (.xls or .xlsx) as the input file.
Create missing folders
If enabled, missing folders in the specified path will be created automatically.
If exists
Specify the behavior of the node in case the output file already exists.
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
  • Overwrite: Will replace any existing file.
Input tables
For each input table, specify which sheet in the Excel file should be updated.
  • Excel sheet: Specify which sheet should be updated by the corresponding input table.
  • Based on address column: Select the name of the column which contains the addresses of the cells which should be updated.
Replace missing values by
If selected, the node will write the specified value as a string to the address if only missing values are found in that row. Otherwise, a blank cell is created.
Replacement value
The value to write in place of a missing value.
Evaluate formulas
If checked, all formulas in the file will be evaluated after the sheet's updates have been performed. This is useful if values that are used in formulas in the sheets have been updated. Note: This can cause errors when there are functions not implemented by the Apache POI library.

Input Ports

Icon
The data table which contains the update information.
Icon
The file system connection.
Icon
Additional data tables which contain update data.

Output Ports

This node has no output ports

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.