OK - missed something in my example.. The xlRangeValue can accept a simple value when writing ONE cell, but when writing a range, it requires an Array of Arrays. The outer array represents the rows, the inner array the columns in each row. Since we had only one row, my example was a simple array.

There was also a typo, probably intoduced when I answered the phone in the middle of my post and came back.. I had typed the name of the function twice.

Adding an "@SERROR ?" after the xlRangeValue() function displayed an error, which lead me to read the header info for that function in more detail. The solution is rather simple, but not obvious:
Change the Dim statement from
 Code:
Dim $Data
to
 Code:
Dim $Data[0]

Then, by adding the "[0]" array reference to the data assignment, we have an array of arrays, which makes the function happy. The file is now generated.

One key thing to point out - note that even though $Data was an array, and now it's a multi-dimensional array, we don't use any element references when we pass it to the functions (ie - we declare $Data[0], we put values into $Data[0], but we pass $Data, not $Data[0]). This syntax indicates that we want to pass the ENTIRE array to the function and not one element.

Here's the updated example code, for testing the xlLib and for your process.

Glenn

xlLib test script:
 Code:
Break On

Dim $Data[0]					; need to declare as an array

$oXL = xlInit()					; initialize Excel
$oWB = xlBookCreate($oXL, 1)			; create a workbook

For $Row = 2 to 11  				; write 10 rows of test data
  $Data[0] = 'ThisHost', 'Responds'		; create an array in array element 0
  $Pos = 'A'+CStr($Row)				; extracted this to be able to display value
  'writing to ' $Pos ?
  xlRangeValue($oXL, $Pos, $Data)		; write in Col A, starting in $Row
  @SERROR ?					; display the result while debugging
Next

xlFile($oXL, 1, 'H:\log.xls')			; write the excel file
xlQuit($oXL)					; close the excel session

Your project code
 Code:
; make sure following UDFs are either CALLed or pasted into the script:
; ReadFile
; Ping
; xlLib
; WMISvcMgr

; good coders declare their vars here... ;)
Dim $Data[0]					; need to declare as an array

; Prepare Excel
$oXL = xlInit()					; initialize Excel
$0WB = xlBookCreate($oXl,1)			; create a workbook

; verify function syntax
$Hosts = ReadFile('myListOfHosts.txt')

$Row = 2					; row of first Excel data, after any headers

; enumerate hosts
For Each $Host in $Hosts
  If Ping($Host)				; got a ping reply, so do effective test
    $Junk = WMISvcMgr('list',,,$Host)
    If Not @ERROR				; got a reply, so computer is alive *1
      $Data[0] = $Host, 'Responds'
      xlRangeValue($oXl, 'A'+CStr($Row), $Data)	; write in Col A, starting in $Row
      $Row = $Row + 1  ; increment row pointer
    EndIf
  Else                 ; no response at all
    $Data = $Host, 'Fails'
    xlRangeValue($oXl, 'A'+CStr($Row), $Data)
    ; might want to consider formatting the data - red text for fail?
    $Row = $Row + 1  ; increment row pointer
  EndIf
Next

; might want to write some header cells before you exit
$ = xlFile($oXL, 1, 'log.xls')			; write the excel file
xlQuit($oXl)					; close the excel session
_________________________
Actually I am a Rocket Scientist! \:D