-
April 21st, 2005 10:59 AM
#1
how can i read color coded cell in excel sheet using vb.net
Hi codeguru,
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.
Thanks,
raf35
-
April 21st, 2005 11:43 AM
#2
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
...
endif
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Click Here to Expand Forum to Full Width
|
Bookmarks