Saleem,

No apology needed! \:\)

The first thing would be to determine if you are actually getting data to write to the file. The best thing would be to write some diagnostic messages, such as:

Right after "If Ping($Host)", you could add " 'got Ping reply from ' $Host ? " - this would tell you if the computer replied.

After the "$Junk = WMISvcMgr('list',,,$Host)" line, you could add
"UBound($Junk) + 1 ' services were found' ?" - this will tell you how many services were reported by the remote system. Zero would indicate a problem that may not generate an error.

If those prove that your logic related to querying the hosts is working, then I'd focus on the Excel write logic. Since this is a new set of functionality for you, I'd recommend that you write a separate small script just to test writing to Excel. Verify that the commands are correct without the complexity of your actual program.. for example

 Code:
oXL = xlInit()                   ; initialize Excel
xlBookCreate(xlBookCreate($oXl,1) ; create a workbook

For $Row = 2 to 11  ; write 10 rows of test data
  $Data = 'ThisHost', 'Responds'
  xlRangeValue($oXl, 'A'+CStr($Row), $Data) ; write in Col A, starting in $Row
Next
xlFile($oXL, 1, 'log.xls')       ; write the excel file
xlQuit($oXl)                     ; close the excel session

Did this create a spreadsheet file with ten lines of data across two columns? Is the data in the range A2:B11?

By creating this simple test, you can verify that the core logic used to update the spreadsheet is functioning. If it fails, you have a very small set of commands to troubleshoot. Once you find the error, you can correct it in your main script and verify the change.

I don't know your scripting proficiency level, but the biggest challenge most of my students have is trying to troubleshoot their entire script at once. I always break things down into small pieces based on (lack of) familiarity or logic complexity. My current project has half a dozen small script segments to test new concepts or verify logic outside of the main script.

I also like to use the Msg() library that I wrote.. the Dbg('message') function will only output messages when the global var $DEBUG is true. Makes it easy to use debugging messages and then turn them off when putting a script into production.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D