home *** CD-ROM | disk | FTP | other *** search
- ' This script contacts Excel to calculate
- ' a math expression and displays the result
-
- Set EXL = CreateObject("Excel.Application")
- Set Args = Wscript.Arguments
- If Args.Count = 0 Then
- Expression = InputBox("Please enter a math expression")
- Else
- Expression = Args(0)
- End If
- On Error Resume Next
- MsgBox Expression & " = " & EXL.Evaluate(Expression)
- If Err.Number > 0 Then
- MsgBox Err.Description
- End If
- Set EXL = Nothing
-