ThankYou Posted December 6, 2011 Share Posted December 6, 2011 (edited) Could I get some help on why i am getting a return 0 on this? Thank you in advance. #include <Excel.au3> #include <Process.au3> #include <Array.au3> $sFilePath = @ScriptDir & "Computers.xls" $oExcel = _ExcelBookOpen ($sFilePath) $dPath = InputBox("File Path", "Enter File Path Location C$..", "", " M") $nFile = FileOpen("No File.txt",1) $fSize = FileOpen("Size Check.txt",1) $i=1 While $i <= 3 $j=1 Sleep(500) ;reduce cpu usage $array = _ExcelReadSheetToArray($oExcel) ;read the sheet into an array $computer = $array[$i][$j] $fPath = "" & $array & $dPath $i=$i+1 $size = FileGetSize($fPath) If $size = 0 then FileWriteLine ($nFile, $computer) Else FileWriteLine($fSize, $size) EndIf WEnd Edited December 6, 2011 by ThankYou Link to comment Share on other sites More sharing options...
Attckdog Posted December 6, 2011 Share Posted December 6, 2011 I haven't really inspected it to thoroughly but you might try using a full path for the FileGetSize() A true renaissance man Link to comment Share on other sites More sharing options...
ThankYou Posted December 6, 2011 Author Share Posted December 6, 2011 I haven't really inspected it to thoroughly but you might try using a full path for the FileGetSize()but the full path changes base on excel sheet. Does FileGetSize only work with full path? I can't have multiple variables like above? Thank you for your help again Link to comment Share on other sites More sharing options...
ThankYou Posted December 6, 2011 Author Share Posted December 6, 2011 I haven't really inspected it to thoroughly but you might try using a full path for the FileGetSize()ah stupid me, sorry for starting a new topic on this. shouldn't have use $array but instead $computer since array was stored in that variable. Thank you for quick reply though Link to comment Share on other sites More sharing options...
Attckdog Posted December 6, 2011 Share Posted December 6, 2011 but the full path changes base on excel sheet. Does FileGetSize only work with full path? I can't have multiple variables like above? Thank you for your help again actually i think you are missing part of your array. "$fPath = "" & $array & $dPath" Should be : $fPath = "" & $array[0] & $dPath $fPath = "" & $array[1] & $dPath or whichever you wanted. I'm guessing you have an entire spread sheet of file names or something similar? A true renaissance man Link to comment Share on other sites More sharing options...
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