home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch20 / scripts / math.vbs < prev    next >
Encoding:
Text File  |  1996-05-12  |  314 b   |  12 lines

  1. ' This script contacts Excel to calculate
  2. ' a math expression and displays the result
  3.  
  4. Set EXL = CreateObject("Excel.Application")
  5. Set Args = Wscript.Arguments
  6. On Error Resume Next
  7. MsgBox Args(0) & " = " & EXL.Evaluate(Args(0))
  8. If Err.Number > 0 Then
  9.     MsgBox Err.Description
  10. End If
  11. Set EXL = Nothing
  12.