Microsoft Excel (XLSXW) Writer Parameters

Usage Notes

Writer Parameters

Overwrite Existing File

  • No (default) – Features will be written to the original file.
  • Yes – Delete an existing file before writing out any features.
Exception: This option cannot be used to delete a destination file that is also the template file. In that case, the writer will append to the destination file, as if this option had been set to No.

Template File

If you specify a template file, the writer will make a copy of the template file in the location specified in the Destination Microsoft Excel File parameter. All operations will be performed on the copy: the template file specified remains unchanged.

Exception: If the template file is also the destination file, then it will be modified. It is not recommended to use the template file as the destination.
Note  The writer feature type option to Drop Existing Sheet/Named Range is ignored if you specify a template file, since the existing sheet/named range will always be replaced by the template sheet/named range. However, the writer feature type option to Truncate Existing Sheet/Named Range is applied to template worksheets/named ranges before being copied to the destination file.

Template Sheet

When you specify a Template File, you can select one of the worksheets as the default template worksheet for each feature type. Click the browse button to view the list.

Named ranges that exist on the template sheet are not duplicated.

The writer feature type option to Drop Existing Sheet/Named Range is irrelevant if specifying a template sheet, since the existing sheet will always be replaced by the template sheet/named ranges. However, the writer feature type option to Truncate Existing Sheet/Named Range is applied to template worksheets/named ranges before being copied to the destination file. To access writer feature type parameters, open the Feature Type dialog.

Remove Template Sheet if Unchanged

If the template sheet is not being modified, setting this parameter to Yes will remove the sheet from the output file. This sets the default for each feature type.

Default: No

Sheet/Named Range Parameters

One writer can have multiple worksheets and/or named ranges created in a new or existing spreadsheet, including multiple named ranges on a single sheet.

Note  Worksheet names must be less than 31 characters in length.

Drop Existing Sheets/Named Ranges

  • Drop sheet: Worksheets are deleted and recreated after all existing worksheets. (The sheet order may change.)
  • Drop named range: Formatting and data in the extents of the existing named range are lost, but formatting in cells that exist outside the named range is unaffected. Original extents of the named range are lost. A new named range is created using the numbers specified in the Feature Type parameters Named Range Start Column and Named Range Start Row.

Truncate Existing Sheets/Named Ranges

If a template file or template sheet are specified as writer options here, the option to truncate existing worksheets or named ranges on feature types is applied to the template sheet before it is copied to the destination file. Inserted items such as charts and pictures are not deleted.

  • Truncate sheet – Formatting such as cell color and column widths that exist in cells outside the data extents remain.
  • Truncate named range – Data and formatting in the extents of the existing named range is lost, but formatting in cells outside this existing named range is unaffected.
  • The Feature Type parameters Named Range Start Column and Named Range Start Row are ignored.

    Data written to the named range use the original start positions and begin writing at the specified offset.

Output Field Names

This parameter specifies whether or not to write the attribute names when inserting data.

When a template file is specified, this parameter is always in effect when inserting data.

If no template file is used, this parameter has an effect only if the sheet or named range is being created or has been dropped or truncated prior to insertion. Otherwise, attribute names will not be added to existing worksheets or named ranges.

Note  Setting this parameter to Yes will enable the Field Names Row Format parameter section. See the Microsoft Excel: Writer Feature Type Parameters for more information on setting the header row format. The Field Names Row Format parameter will be disabled when this option is set to No.

Field Names Row Format

This parameter sets the format of the field names or header row.

When this option is checked, the different format options are enabled. The formatting is set only when writing the header row (which is done once per sheet).

Note   This formatting will not be applied to existing worksheets or named ranges.

Default Feature Type Writer Mode

The writer mode can be specified at two unique levels: on the feature type, or on individual features.

At the writer level, the writer mode specified by this parameter is inherited as the starting writing mode for all of its feature types. This determines how each feature received is treated by default. Valid writer modes are listed below:

Mode Description
Insert

Appends features to the end of the sheet or writes them to an exact row and column position. Any data that already exists at that location will be overwritten.

If a value on the feature is specified for the Row Number column, that row will be used instead.

Note  The Insert feature type writer mode will ignore any feature-level writer modes using fme_db_operation. If per-feature writer modes are desired, consider using Update at the feature type level.
Update

Causes the row corresponding to the feature’s value specified in the Row Number Attribute to have its data changed to the values on the incoming feature.

If an attribute is missing while in this mode, the existing cell value will not be overwritten.

Note  In FME versions before 2021.1, the Use Attribute Names as Column Positions option must be enabled for this to behave as expected.
Delete

Deletes the values in the row corresponding to the feature’s value specified in the Row Number Attribute.

Only a number of columns equal to the amount of columns in the schema will have their data and formatting removed.