Hello,
After investigation, I guess that you set the fill color for the cell instead of the background color, therefore, you need to use the following code to get the fill color.
- Code: Select all
string colorName = range.Style.PatternColor.Name;
If this code doesn't meet your requirement, to help us reproduce your issue and work out a solution for you, please offer the following message.
1) Your excel file.
2) Application type, such as Console App, .NET Framework 4.8.
3)Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
Sincerely
Abel
E-iceblue support team