Opens excel (hidden)
searches for information
finds match and saves cell info in variable
closes excel
It works pretty well but it's slow. I have a feeling if the information was already in an array it would run much faster. Apparently I have a mental block against excel arrays because I just can't figure it out.
Code: Select all
oLinksDoc := ComObjCreate("Excel.Application")
Sleep, 200
oLinksDoc.Workbooks.Open(LinksFullPath)
oLinksDoc.Visible := False
Sleep, 200
Loop, 1500
{
CurrentLinkRow := A_index
Global LType := oLinksDoc.Range("E" CurrentLinkRow).Text
Global SType := oLinksDoc.Range("B" CurrentLinkRow).Text
;msgbox % LType " | " Type " | " SType " | " State
If (SType = State && LType = Type)
{
FoundLink := oLinksDoc.Range("C" CurrentLinkRow).Text
Global FoundLink := FoundLink
oLinksDoc.ActiveWorkBook.Save()
oLinksDoc.ActiveWorkBook.Close()
oLinksDoc.Quit
;msgbox % FoundLink
;WinWaitClose, ahk_class #32770
break
}