The reason for this difference is because the RGB function does not exist for C# and the class cannot be used directly to generate the color values in the correct format. NET Framework, colors are represented using the class stores a color's RGB component values as an integer in the AARRGGBB format. The alpha component is 0 and the blue component is in a more significant byte position than the red component. You could create a C# method that would be the equivalent of the Visual Basic RGB function, but for the purposes of this article, the code simply uses hard-coded values. After the code saves the Excel 2007 workbook, it closes the workbook and the application objects and releases references to the underlying Excel 2007 COM objects. For more information about how to release COM objects when using managed code, see Chapter 2: Basics of Office Interoperability (Part 2 of 3) from Microsoft . For example, conditional formatting can answer requests such as "Show me the top 10 percent of all sales for North America," or "Show me only Nancy's sales for the year." Excel 2007 provides several enhancements to conditional formatting.
The format issue has to do with the difference in the way that the Microsoft . The two most significant bytes represent the color's alpha value, followed by the red, green, and blue color component values.
all very simple formulas [if (cell 0,1,0)] was the original formula for example.
this has translated over to excel 2010 but only partially works.
For example, when i change the cell contents triggering the rule true/false it does not refresh the relevant cells' formatting.
Microsoft Office Excel 2007 provides enhanced conditional formatting support.
Conditional formatting allows you to apply formatting to one or more cells based on the value of the cell or the value of a formula.
This article illustrates how to use the Microsoft Excel 12.0 Object Library to programmatically set conditional formatting on a range of cells using color scales and icon sets.
variable to call methods that accept optional parameters.
Optional parameters are only optional when you use Microsoft Visual Basic.
You must specify a value for optional parameters when you use Microsoft Visual C#.