AlchemistZim Posted May 26, 2020 Posted May 26, 2020 Opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand Opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase #include <Excel.au3> #include <File.au3> #include <Inet.au3> Global $oExcel = _Excel_Open(True, False, True, True, True) Global $sSpreadsheet = "C:\Users\MiBrown\Desktop\Win10 Upgrade\Sorted.xlsx" Global $oWorkbook = _Excel_BookOpen($oExcel, $sSpreadsheet) For $i = 2 To 10 $sCellA = "A" & $i $sCellB = "B" & $i $sCellC = "C" & $i $sCellD = "D" & $i $sCellE = "E" & $i $sPCName = _Excel_RangeRead($oWorkbook, DEFAULT, $sCellB) $sIP = _Excel_RangeRead($oWorkbook, DEFAULT, $sCellC) If $sPCName = "" Then CleanExit() If $sIP = "" Then ContinueLoop If FileExists("\\$sPCName$\c$\Tools") Then _Excel_RangeWrite($oWorkbook, DEFAULT, "YES", $sCellD) If FileExists("\\$sPCName$\c$\Program Files (x86)\GTPC\tray.exe") Then _Excel_RangeWrite($oWorkbook, DEFAULT, "YES", $sCellE) Next Func CleanExit() _Excel_Close($oExcel, True, False) Exit EndFunc So I have a list of PCs (Column-B) that I run a ping test on, from the ping test, I copy the IPs to Column-C If the $sPCName is empty the script saves and closes If the $sIP address is empty the script is supposed to ContinueLoop to the next entry...ITS NOT DOING THIS Its still trying to look for files on the computer even thought the ping test fails I've tried IsKeyword, IsDeclared, comparing the cell directly The only way that ive gotten this to work is by setting all of the blank cells to a single unique string ("NoIP"), and look for that Can anyone tell me what I'm doing wrong?
Danp2 Posted May 26, 2020 Posted May 26, 2020 You're probably getting a Null value instead of an empty string. Try changing the line to If String($sIP) = "" Then ContinueLoop Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now