;; KixGenerated: 2007/09/26 - 19:54:31
Break On
;Working with Excel, for example
; Define an Excel object pointer
$oXL = xlInstantiateApp()
; Open the file
xlFile($oXL, 0, 'c:\temp\test.xls')
'Open: ' @SERROR ?
; Return an array of 4 values from the first data row
; Start with row 2, since row 1 has titles
; keep reading until a blank row is returned
$Row = 2
While $Row > 0
$Range = 'A' + CStr($Row) + ':D' + CStr($Row)
$aData = xlRangeValue($oXL, $Range, , 'Sheet1')
For Each $ in $aData
$ ?
Next
; The first element of the array contains the user, fourth has the manager
; Howard Bullok has a great Hash UDF that would work well here, but
; I'm going to use a "poor-man's" hash - an INI file, and reduce the number
; of UDFs required
If $aData[0]
; Anti-Golf to make it clear what data goes where
$User = $aData[0]
$Manager = $aData[3]
$Record = Join($aData, Chr(31))
$ = WriteProfileString('.\hash.ini', $Manager, $User, $Record)
Else
$Row = -1 ; no more data - exit the loop
EndIf
$Row = $Row + 1
Loop