Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can I automatically set a cell color in an Excel spreadsheet using VB6?

Posted on 2006-06-28
2
Medium Priority
?
401 Views
Last Modified: 2011-09-20
I test contents of the field values in a recordset.  The records are written out to an Excel spreadsheet . I want to be able to set cell color based on the results of the test. I can easily create and populate the worksheet but do not see a way to set the cell color. While a solution is desired, a definitive "can't do that" will earn the points.
0
Comment
Question by:rkulp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
hes earned 500 total points
ID: 17001638
Try
objSpreadsheet.Cells(1,1).Interior.Color = RGB(229,229,231)
' or whatever you have your spreadsheet called or
objSpreadsheet.Cells(1,1).Interior.Color = vbRed
0
 
LVL 1

Author Comment

by:rkulp
ID: 17001695
Thank you.  Works like a champ.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question