Reading excel color information into VB.NET

Spacy

New member
Joined
Jan 27, 2005
Messages
1
Re: Reading Colors from Excel

Hi,

I would like to know how you achieved reading from excel.
I know that the data can be read by using excel as datasource.
But, apart from reading data, i also want to read the
foreground and background colors of the cells.
Please help me.


Regards,
Spacy.


Antoine said:
Hello,

Is there a possible way to get the back and foreground color form an excel cell ?

For instance:
The backcolor of the cell is made red
The forecolor of the cell is made blue

Is there a way to get these values into variables for one cell ? I allready managed to read data from an excelsheet. But now I also want to try to get other attributes.

Who can help me ?

Regards,
Antoine
 
Spacy,

To do this you would have to open up Excel programmatically, you cant do this remotely as you would say using ADO to read the data. Once opened, you could read the Range.Interior.ColorIndex and the Range.Font.ColorIndex.

For a backgrounder on Automating/Controlling Excel, you could read here: Automating Office Programs with VB.Net / COM Interop.

Let us know if we can help further...

-- Mike
 
Back
Top