Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Excel lookup table problems

$
0
0
Hi,

I have an AutoIt script that does a lookup in an .xls file and when a match is found it copies data from an offset cell.
This part works fine, but I cant seem to control when a match is not found.

The ;~ part is what I am hoping someone can help with.


Func Lookup()
$oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 0
$oExcel.WorkBooks.Open ("\\document\location\name.xls")
With $oExcel.ActiveSheet.Range("A:A").Find ($Name)
$Match = .Find ($Name)

;~ If $Match = False Then
;~ do something Then
;~   Exit
;~ Else
;~    do some other thing
;~ EndIf  
  
   $Match.Offset (0, 1).copy
EndWith
  
$oExcel.Quit
EndFunc

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>