The problem is transposition. Somehow, due to obscure standards in the far distant past, color management is a mess. For colors to be applied via VBA, you need to swap the Red and Blue hex values.
Meaning #BA1419 will display as red when TYPED into the property in the property sheet, but it will need to be #1914BA to display red when set by VBA in the property sheet. Sounds insane? Try it.
Here's a function that will convert a value such as #BA1419 to a decimal value (with the right color) that can be assigned by VBA to the backcolor. This avoids having to swap the fore and aft yourself.
Want more insanity? You can't TYPE the calculated decimal value from the function into the property sheet - VBA has to do it!!
Function usage: Feed it temp1 as the parameter
ReportHeader.Backcolor = fcnHexToDecimal(temp1)
Here's the function. Add it to a module or you can include it in the report's code module.
Code:
Public Function fcnHexToDecimal(ByVal hexColor As String) As String 'Example HexColor = "#00FF1F"
Dim Red As String
Dim Green As String
Dim Blue As String
hexColor = Replace(hexColor, "#", "")
Red = Val("&H" & Mid(hexColor, 1, 2))
Green = Val("&H" & Mid(hexColor, 3, 2))
Blue = Val("&H" & Mid(hexColor, 5, 2))
fcnHexColToDecimal = RGB(Red, Green, Blue)
'The output is a decimal value
End Function