mrtweaver Posted July 31, 2018 Share Posted July 31, 2018 Ok so i am using ExcelCOM_UDF.au3, which by the way is very nice UDF for excel. However I must be missing a step or something and was hoping that someone on here could lend a hand. I am using the following code in my program: _ExcelCellColorSet($oExcelDoc, "c4", 4, 4,4, 22) And here is what is written inside the UDF ;=============================================================================== ; ; Description: Set the cell interior color value of a range in an Excel object. ; Syntax: _ExcelCellColorSet($oExcel, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1, _ ; $iColorIndex = 1, $hColor = 0x000000) ; Parameter(s): $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew() ; $sRangeOrRowStart - Either an A1 range, or an integer row number to start from if using R1C1 ; $iColStart - The starting column for the number format(left) (default=1) ; $iRowEnd - The ending row for the number format (bottom) (default=1) ; $iColEnd - The ending column for the number format (right) (default=1) ; $iColorIndex - The interior color index (default = 1, if > 254 then $hColor is used instead) ; $hColor - Hex value of color used when colorindex > 254 ; Requirement(s): None ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @error on errors: ; @error=1 - Specified object does not exist ; @error=2 - Starting row or column invalid ; @extended=0 - Starting row invalid ; @extended=1 - Starting column invalid ; @error=3 - Ending row or column invalid ; @extended=0 - Ending row invalid ; @extended=1 - Ending column invalid ; Author(s): SEO <locodarwin at yahoo dot com> ; Note(s): None ; ;=============================================================================== What i would like to do is to be able to take the same row in three different columns and change it to the same color. So like A4, B4, C4 or such. But not matter what i have tried I can only get 1 row and 1 column at a time to change color. SO what did i miss? What needs to be changed so that it would say start at A4 and go to C4? I have tried to adjust the number and no matter what numbers i change there does not seem to be any change on my screen. Thanks for your time and patience. Martin Link to comment Share on other sites More sharing options...
water Posted August 1, 2018 Share Posted August 1, 2018 I would try: _ExcelCellColorSet($oExcelDoc, "A4:C4", 4, 4,4, 22) BTW: The latest version of AutoIt comes with its own Excel UDF My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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