Skip to main content
Question

Highlight Cells in Existing Worksheet

  • May 7, 2018
  • 2 replies
  • 12 views

Hi Everyone,

I have a workflow that takes a submitted Excel workbook and validates all of the input. The validations are not simple and often require checking data against databases, checking against other rows/tabs in the workbook etc. At the moment, I am writing out any issues/validation failures to a text file e.g. The value: 'XYZ' supplied on Tab: 'Tab1' in Row:5 Column:'C' is invalid for reason 'ABC'. I would like to highlight Cell C5 in red on the original file and send it back.

I don't want to create a new file or write all the data back out, just simply locate specific cells in the file I read in at the start and change their formatting. Is this possible? Thanks!

J

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • May 8, 2018

Hi @granty555, I don't think FME can set format to existing Excel worksheet. However, it seems that the Excel writer can be used to overwrite only format of cells in a template, so this could be a workaround.

  1. Specify the source worksheet as a template for the Excel writer to create a new Excel file containing a copy of the original worksheet,
  2. read the original worksheet with format information (i.e. read "<attribute name>.formatting" attributes),
  3. and then overwrite only format of specific cells in the destination worksheet.

See also this demo: xlsxr2xlsxw-demo.fmwt (FME 2018.0.0.3)


Forum|alt.badge.img
  • January 10, 2019

Hi @granty555, I don't think FME can set format to existing Excel worksheet. However, it seems that the Excel writer can be used to overwrite only format of cells in a template, so this could be a workaround.

  1. Specify the source worksheet as a template for the Excel writer to create a new Excel file containing a copy of the original worksheet,
  2. read the original worksheet with format information (i.e. read "<attribute name>.formatting" attributes),
  3. and then overwrite only format of specific cells in the destination worksheet.

See also this demo: xlsxr2xlsxw-demo.fmwt (FME 2018.0.0.3)

Which versions of FME support this "formatting" attribute? e.g. Does 2016 support it? Thanks.