Fill the colour of a cell in excel using ColorDialog box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nanaalwi
    New Member
    • Dec 2006
    • 5

    Fill the colour of a cell in excel using ColorDialog box

    Hi all,

    I'm doing a software using vb.net that related to excel. The software that i implement requires filling the color inside the cells. Previously, the source code that I used is:

    objSheet.Cells( 1,3).Interior.C olorIndex = 56

    Using this source code. the color is fixed by me. (Color index 56 = Black).
    However, I need to write the software in such a way that the user can select the color thay they want.
    How do I fill the color of a cell in the excel sheet using ColorDialog box? Meaning that the user can select which color they want to use to fill the cells using the ColorDialog box.

    Thanx in advance..Really appreciate ur help..




    Does anyone know how to obtain the color index from ColorDialog box?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Hm... could be a job for the common dialog control.

    If interested, you need to add the Microsoft Common Dialog Control (whatever version) to your project. The doco will tell you how to use it to provide a colour-picker.

    Not sure how to go about getting the color index, though.

    Comment

    Working...