Hi @geralA8ZZM,
As a follow-up to this thread, I put together a small demo tool that solves this the "hard way" reading the color directly from the rendered legend, since there's no API property for it.


How it works
- Open a Robot project containing bars with sections
- Open the attached Excel workbook and click the "Run" button.
- The program captures the active view as an image, locates the color legend in the bottom-right corner, and calibrates the scan width from the detected color swatches.
- It runs OCR on that calibrated legend area to read each section name, then writes a CSV (section name + RGB values) to your temp folder.
- The Excel macro reads that CSV back and lists each section with its color.
Before running it
The .exe is unsigned, so most antivirus software will flag or quarantine it on first run, this is a not an actual detection. You'll need to add the extracted folder to your antivirus exclusion list before running it (Windows Security → Virus & threat protection → Manage settings → Exclusions → add the folder).
Current limitation
The software automatically detects the active theme, font, and text color. If the legend does not fit in the available space, as many views as necessary are created.
With font sizes below 8 pt, some entries may be omitted if OCR cannot read them reliably or if they fail to meet the 7/15-character matching threshold.
Using it in your own workflow
The macro is meant as a starting point, not a finished tool, since the CSV gives you the section name and its RGB color side by side, you can match it against your own bar export by section name, and apply the color to whichever cell/column makes sense for your export.
Extra option (advanced)
The tool also supports extracting materials or member types instead of section colors, via a command-line flag:
/s — bar sections (default, used by the demo workbook)
/m — materials
/t — member types
If you want to try one of these from the macro, just append the flag to the Run call
ws.Run """" & exePath & """ /t", 0, True
Honest caveat
This is a prototype built to solve the simple, common case, not a general-purpose solution for every theme, every view configuration, or very large models. If you run into a case it doesn't handle, feel free to reach out and I'll see what can be done.
Workbook + tool attached below. Updated 26/08/26
Best Regards
Stéphane Kapetanovic
Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
