Jump to content

Autoit Excel Color Command


Recommended Posts

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...