How to set the range for "Get Cell Color" activity to consider the entire Excel sheet?

Hello, I am trying to detect if there are any highlighted cells in an Excel sheet. If so, it will show a message that says “there are invalid inputs”. I managed to do so but the message shows up every time there is a red box. It is quite illogical to tell the user that the sheet has errors so many times. Is there a way to check across all rows, and all columns for highlighted cells, and once it finds the very first highlighted cell, it stops the process and informs the user about it?

Excel sample:

What I have now:

Hi @thedriedseaweed88

Try this flow:

Highlighted = False

For Each Row in DataTable
  For Each cell in DataTable.columns
    Use Get Cell color activity for current cell
    If System.Drawings.Color.Red
      Highlighted = True
      Use Break activity
  If Highlighted = True
    Use Break activity
If Highlighted = True
  Message Box: "There are invalid inputs"

Hi @thedriedseaweed88,

Here is the sample flow for your requirement.

Sequence.xaml (16.2 KB)
sample.xlsx (8.7 KB)

Hope it helps!

Thanks!

Managed to solve the issue! Thank you for your help! :grinning: :grinning:

1 Like

Works perfectly! Thanks a lot! :grinning:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.