|
-
Jan 22nd, 2010, 10:56 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Excel Automation - Change color pallette
I am using the late binding method to automate Excel from within a VB6 application. It works fine (thanks to si the geek's tutorial in this Forum).
A limitation seems to be the number of colours available for use in cells. It seems there are just 56 referred to as colorIndex as in this line of code:
oXLSheet.Range("A1:M1").Interior.ColorIndex = 6 'Give top row of table a yellow background
I have read that it is possible in code to modify the Excel default pallette of 56 colours such that, while still being limited to just 56, these can be redefined by code to be any desired RGB value. However the code examples I found refer to VBA and do not seem to work with VB6.
In the case of the above line of code, how could I modify the default Excel palette so that, for example, ColorIndex 6 becomes RGB(255,000,000) [which would make it bright red instead of yellow]?
Suggestions appreciated.
camoore
Wales, UK
Last edited by camoore; Jan 22nd, 2010 at 11:08 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|