Jump to content
Sign in to follow this  
Kiti

Wrong Color

Recommended Posts

Kiti

I've used locodarwin's UDF to colour up some cells in Excel. But almost everytime, I get another color than the one I've specified. For example:

#include <ExcelCOM_UDF.au3>
Local $oExcel = _ExcelBookNew(1)
_ExcelCellColorSet($oExcel, 1, 1, 5, 1, 255, 0xFF0000)

Colors in 0x0000FF :):P

Had anyone this problem before, or know how to solve it?

Is there any workaround?

Edited by Kiti

Share this post


Link to post
Share on other sites
Kiti
SmOke_N

I've used locodarwin's UDF to colour up some cells in Excel. But almost everytime, I get another color than the one I've specified. For example:

#include <ExcelCOM_UDF.au3>
Local $oExcel = _ExcelBookNew(1)
_ExcelCellColorSet($oExcel, 1, 1, 5, 1, 255, 0xFF0000)

Colors in 0x0000FF :):P

Had anyone this problem before, or know how to solve it?

Is there any workaround?

Well it's obviously using BGR rather than RGB... and I believe they removed the Opt("ColorMode") option... I wrote a simple converter that converts RGB to BGR or BGR to RGB just by passing the colorref.

_ColorConvert

So in your instance, you would do:

_ExcelCellColorSet($oExcel, 1, 1, 5, 1, 255, _ColorConvert(0xFF0000))

Let me know if that worked for a quick fix.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Kiti

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.