473,492 Members | 4,279 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Forecolor of Excel Cell in .Net

1 New Member
Hi All,
I am working on an application in which I have to call an excel file and have to find the forecolor of a particular cell whether it is green or red. Would anybody please let me know how I can implement this functionality in my application.

thanks & regards
Rahul
May 1 '07 #1
1 1478
SammyB
807 Recognized Expert Contributor
Hi All,
I am working on an application in which I have to call an excel file and have to find the forecolor of a particular cell whether it is green or red. Would anybody please let me know how I can implement this functionality in my application.

thanks & regards
Rahul
There is no enum for this, but if you record a macro, you will see that green is 10 and red is 3:
Expand|Select|Wrap|Line Numbers
  1. Sub Macro1()
  2.     Range("A1") = "Red"
  3.     Range("A1").Font.ColorIndex = 3
  4.     Range("A2") = "Green"
  5.     Range("A2").Font.ColorIndex = 10
  6. End Sub
Excel MVP, Dave McRitchie, has a nice chart of all the colors, http://www.mvps.org/dmcritchie/excel/colors.htm#Chart
May 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2675
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
3
6221
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
5362
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.