Hahaha, cheers though.
Yeah if there's a programmatic way to get that status bar text, I would like to know, even though I don't use Excel 2003 any more, just because ... you should never let yourself be defeated by the software.
==================================================
2 simple functions relating to highlighting, tested on Excel 2007. I generally do everything via macros, but the 3 functions on this page are the few exceptions.
Code: Select all
;==================================================
;e.g.
;WinGet, hWnd, ID, ahk_class XLMAIN
;JEE_ExcelFillColor(hWnd)
;return
;tested on Excel 2007
;requires Acc library
;click the Fill Color button
JEE_ExcelFillColor(hWnd)
{
ControlGet, hCtl, Hwnd,, NetUIHWND2, % "ahk_id " hWnd
oAcc := Acc_Get("Object", "4.14.1.1.2.11.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
oAcc := ""
}
;==================================================
;e.g.
;WinGet, hWnd, ID, ahk_class XLMAIN
;JEE_ExcelFillColorSet(hWnd, "FF0000,FFFF00,")
;return
;tested on Excel 2007
;choose the highlight colour from the Colors dialog or click Fill None
;JEE_ExcelRecentColorsAdd
JEE_ExcelFillColorSet(hWnd, vList)
{
StrReplace(vList, ",", "", vCount), vCount += 1
Loop, Parse, vList, % ","
{
if (A_LoopField = "")
{
SendInput !hhn ;No Fill
continue
}
SendInput !hhm ;Colors dialog
Loop, 3
vCol%A_Index% := "0x" SubStr(A_LoopField, (A_Index*2)-1, 2)
WinWaitActive, Colors ahk_class bosa_sdm_XL9
WinGet, hWnd, ID, Colors ahk_class bosa_sdm_XL9
Sleep 1000
SendInput ^{Tab}
ControlSetText, RichEdit20W10, % vCol1+0, % "ahk_id " hWnd
ControlSetText, RichEdit20W11, % vCol2+0, % "ahk_id " hWnd
ControlSetText, RichEdit20W12, % vCol3+0, % "ahk_id " hWnd
SendInput {Enter}
WinWaitNotActive, % "ahk_id " hWnd
if (A_Index = vCount)
Sleep 1000
}
}
;==================================================