Get cell color
Command Description
Read the color of the specified cell in the worksheet (represented by an RGB array)
Command Prototype
sRet = Excel.GetCellColor(objExcelWorkBook,sheet,strCell)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
objExcelWorkBook | True | expression | objExcelWorkBook | Workbook objects returned by the Open Excel Workbook command (Excel. Open) or Bind Excel Workbook command (Excel. BindBook) |
sheet | True | string | "Sheet1" | If a string is used, it represents the name of the specified worksheet; Using numbers indicates the order of the specified worksheet (starting from 0) |
strCell | True | string | "A1" | The specified cell supports both cell names such as "A1" and row column arrays such as [row number, column number]. When using cell names, they are not case sensitive |
Return result
SRet, Assign the result of running the command to this variable.
Run instance
/*********************************Get Cell Color*************************************
Command Prototype:
sRet = Excel.GetCellColor(objExcelWorkBook,sheet,strCell)
Input Parameters:
objExcelWorkBook -- Workbook object. Note: The workbook object returned by the "Open Excel Workbook" command (Excel.Open) or the "Bind Excel Workbook" command (Excel.BindBook).
sheet -- Worksheet. Note: If using a string, it represents the name of the specified worksheet; if using a number, it represents the index of the specified worksheet (starting from 0).
strCell -- Cell. Note: The specified cell, supports both cell names (e.g., "A1") and row-column arrays (e.g., [row number, column number]). Cell names are case-insensitive.
Output Parameter:
sRet -- The variable where the output of the function call will be saved.
Notes:
None
********************************************************************************/
Dim sRet = ""
sRet = Excel.GetCellColor(objExcelWorkBook,"Sheet1","A1")
TracePrint(sRet)