View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Interop - "Unable to set the Color property of the Interior class"

VB/VBA has the RGB() function to return a Long from the 3 components.
Couldn't tell you about C#.

NickHK

"Elsa" wrote in message
...
The reason of this error was that the worksheet was protected. I

unprotected
it and now almost 70% of the conditional formats are successful. The ones
that are problematic are those that have the inequality operator "<"

along
with a number, as in the following (the named range does exist, the thread

is
US):

=OR((IF(ISBLANK(Q36540A4),0,Q36540A4))<0)

Even if I use NOT to avoid using the <, as the following:

=OR((NOT(IF(ISBLANK(Q36325A3),0,Q36325A3))=0))

I get an error "Exception from HRESULT: 0x800A03EC" with stack trace as
follows:

at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Excel.FormatConditions.Add(XlFormatConditionType Type, Object
Operator, Object Formula1, Object Formula2)
at

Gartner.Decm.BusinessLayer.ExportToExcel.CreateCel lHideCriteria(Range
cellRange, StringBuilder formulas) in

D:\Versioning\Aurora\trunk\DECMBusinessLogic\Utili ties\ExportToExcel.cs:line
1101

Also, would anybody know the translation from RGB to hexadecimal for color

R
253, G 250, B 255?

Many thanks for any information that you can provide.

Elsa