Jump to content

Recommended Posts

Posted (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 by great77
Posted
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...