Hello,
I am using an Excel file for saving, deleting and updating data. I just want to change a cell's background color to "Red" when cell's value greater than "50". How may I do that?
How to change an Excel cell's background color?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Nov 2, 2011, 4:43 AM EDT
I was expecting that you'd already have a lot of Excel interop code written and were just wanting to slot this piece of code into that. However, it sounds like that's not the case :)
As Excel interop is a complicated subject, I'd read this Microsoft article before you do anything else :
http://support.microsoft.com/kb/302084
You will need to add a reference to whatever is the latest Excel object library on your machine and will also need this using directive in your C# source code file to get it all to work:
using Excel = Microsoft.Office.Interop.Excel;
VulpesRank #55 · 29.2K reputationPosted Nov 2, 2011, 2:39 AM EDT
yokzuRank #5,421 · 300 reputationPosted Nov 2, 2011, 3:54 AM EDT
I think I must add "Microsoft Office Excel 14.0 Library" to the project? I added this library but Im getting error on "oSheet" variable.(Doesnt exist in the current context). Did I add wrong library or am I missing somethings?