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?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Nov 2, 2011, 8:43 AM
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;
yokzuPosted Nov 2, 2011, 7:54 AM
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?
VulpesPosted Nov 2, 2011, 6:39 AM