I am new to the world of COM, and I need to work out how to search across all sheets within a given file.
Here is the code I am using to search at the moment:
Code: Select all
LinkedExcel := Excel_Get()
LinkedExcel.Columns().Select
LinkedExcel.Selection.Find("blah", LinkedExcel.ActiveCell).Select
[...]
; =============================================================================================================
; 3rd party functions
Excel_Get(WinTitle="ahk_class XLMAIN") {
; by Sean and Jethrow, minor modification by Learning one
; http://www.autohotkey.com/forum/viewtopic.php?p=492448#492448
ControlGet, hwnd, hwnd, , Excel71, %WinTitle%
if (!hwnd){
return
}
Window := Acc_ObjectFromWindow(hwnd, -16)
Loop {
try {
Application := Window.Application
} catch {
ControlSend, Excel71, {esc}, %WinTitle%
}
} Until !!Application
return Application
}