April 21st, 2005, 10:59 AM
how can i read color coded cell in excel sheet using vb.net
I have a color coded excel sheet that is every cell has a different color. How can I read the colors in vb.net. I appreciate any help.
April 21st, 2005, 11:43 AM
Re: how can i read color coded cell in excel sheet using vb.net
Here is a solution to use the color by using its index.
dim colorindex as integer
colorindex = ExcelSheet.Range("A1:A1").Interior.IolorIndex
Once you read the color index, you can change color in another cell by
ExcelSheet.cells(5,1).Interior.ColorIndex = colorindex
You can also check if another cell has this same color by
if colorindex = ExcelSheet.Cells(5,1).Interior.colorindex then
I don't know how to convert color index to a color object in System.Drawing. Hope this will do what you want. Good Luck.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!