CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005

    Question 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.


  2. #2
    Join Date
    Dec 2002

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.