SiteMaze Posted May 20, 2008 Share Posted May 20, 2008 I am using the Excel_Com UDF to change the colour of a cell. $tmp_str_BinColour = 0xFFFFFF _ExcelCellColorSet($oExcel, 45, 17, 45, 17, 256, $tmp_str_BinColour) The above code works but how do I store Hex values in a variable? I have the colour stored in a database. So when I retreive it is in string type. And it doesn't work. $tmp_str_BinColour = "0xFFFFFF" _ExcelCellColorSet($oExcel, 45, 17, 45, 17, 256, $tmp_str_BinColour) Arsenal Football Fan Club in Singapore Link to comment Share on other sites More sharing options...
ProgAndy Posted May 20, 2008 Share Posted May 20, 2008 Try to use: $tmp_str_BinColour = Binary("0xFFFFFF") *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
SiteMaze Posted May 20, 2008 Author Share Posted May 20, 2008 Try to use: $tmp_str_BinColour = Binary("0xFFFFFF") It is not working. "Failure with the excel object" error. Arsenal Football Fan Club in Singapore Link to comment Share on other sites More sharing options...
ProgAndy Posted May 20, 2008 Share Posted May 20, 2008 Try StringToBinary("0xFFFFFF") or Execute("0xFFFFFF") *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
SiteMaze Posted May 20, 2008 Author Share Posted May 20, 2008 Thanks. Execute("0xFFFFFF") worked. Arsenal Football Fan Club in Singapore Link to comment Share on other sites More sharing options...
SiteMaze Posted May 21, 2008 Author Share Posted May 21, 2008 Sorry, I was too fast to jump the train. Execute("0xFF0000") returns 16711680 which is blue colour, and not red. Arsenal Football Fan Club in Singapore Link to comment Share on other sites More sharing options...
Malkey Posted May 21, 2008 Share Posted May 21, 2008 Sorry, I was too fast to jump the train.Execute("0xFF0000") returns 16711680 which is blue colour, and not red.I am guessing here.If "0xFF0000" returns blue, the BGR colour scheme could be in use.If "0x0000FF" returns Red then the BGR color scheme is being used. As opposed to the RGB color scheme. Link to comment Share on other sites More sharing options...
SiteMaze Posted May 21, 2008 Author Share Posted May 21, 2008 I am guessing here.If "0xFF0000" returns blue, the BGR colour scheme could be in use.If "0x0000FF" returns Red then the BGR color scheme is being used. As opposed to the RGB color scheme.LOL, you are correct. Just didn't suspect AutoIT will be using the BGR code. I thought it was more to do with the datatype thingy.So now I had to convert the RGB from my database to BGR and then run through 'execute'. Work great! Arsenal Football Fan Club in Singapore Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now