This one has better error checking ...

 Code:
Break On

$= SetExcelValue("c:\sheet.xls", "tuesday", "B5", "123")

Exit 1

Function SetExcelValue($path, $sheet, $range, $value)

 Dim $Excel
 Dim $WorkBook
 Dim $WorkSheet

 $Excel = CreateObject("Excel.Application")

 If @ERROR = 0
 
  $WorkBook = $Excel.WorkBooks.Open($path)

  If @ERROR = 0

   $WorkSheet = $WorkBook.Sheets.Item($sheet)

   If @ERROR = 0

    $WorkSheet.Range($range).Value = $value

    $= $WorkBook.Save()

    $WorkSheet = 0

   Endif

   $WorkBook = 0

  Endif

  $Excel.Quit
  $Excel = 0

 Endif

 Exit @ERROR

EndFunction