Solved

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

Posted on 2006-06-28
2
334 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
2 Comments
 
LVL 20

Accepted Solution

by:
hes earned 125 total points
Comment Utility
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
Comment Utility
Thank you.  Works like a champ.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now