great77 Posted January 29, 2016 Author Share Posted January 29, 2016 (edited) 4 hours ago, kylomas said: No problem and Good Luck with the rest of your project! kylomas Thank you so much. it works to drop the column that has value 2, The new code after I change the B column to C column and add ; the $cmd2 &= '[' to start the parenthesis. Many thanks Local $oExcel = _Excel_Open() if @error then exit msgbox(17,'Excel Error', 'COM error code is ' & @extended) local $oWorkbook = _Excel_BookOpen($oExcel, $myfile, false, false) if @error then exit msgbox(17,'BookOpen Error', 'ERROR code is ' & @ERROR) local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:C"), 2, False) ;; 2 return formulat and True, transpose if @error then exit msgbox(17,'RangeRead Error', 'ERROR code is ' & @ERROR) _Excel_Close($oExcel) if @error then exit msgbox(17,'Close Error', 'ERROR code is ' & @ERROR) _arraydisplay($aResult) local $cmd2 ='{"hostIds":' $cmd2 &= '[' ; i added this to start the paarenthesis for $y = 3 to ubound($aResult) - 1 if $aResult[$y][2] <> '2' then ;;; COLUMN 2 IS C COLUMN IF CORRUPT STATUS IS 2 $cmd2 &= $aResult[$y][0] & ( $y = ubound($aResult)-1 ? '' : ',' ) Else ConsoleWrite('Dropped HostID = ' & $aResult[$y][0] & @CRLF) endif Next $cmd2 &= ']}' MsgBox(0, 0, $cmd2) Edited January 29, 2016 by great77 Link to comment Share on other sites More sharing options...
kylomas Posted January 29, 2016 Share Posted January 29, 2016 great77, Your right, I dropped the freakin brackets, d'oh! Looks like you have it well in control. kylomas great77 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
great77 Posted January 30, 2016 Author Share Posted January 30, 2016 19 hours ago, kylomas said: great77, Your right, I dropped the freakin brackets, d'oh! Looks like you have it well in control. kylomas Yea thanks. Your support helps greatly. Cheers Kylomas 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