79145111

Date: 2024-10-31 14:28:40
Score: 0.5
Natty:
Report link

I was offsetting by 1 column too much. In addition, Sheets(1) does not refer to Sheet1 in excel, I have no specified the sheet name. The error is given when nothing can be found, I prevented this with a Try & Catch Error combo. Working code:

^+F1::
{
Try {

title := WinGetTitle("A") ; Works
UniqueRef := Trim(SubStr(title,1,InStr(title," (")-1)) ; Works

xl.Sheets("CURRENT").Range("A:A").Find(UniqueRef).Offset(0,10).Value := ComObjActive("Excel.Application").ActiveCell.Value ;WORKS!
} Catch Error {

    msgbox "Unable to locate reference.","Error."

}
Return
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: itz_reecey