home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 29 / XENIATGM29.iso / ie / ie40pp1 / ie4 / wsh.cab / excel.vbs < prev    next >
Text File  |  1996-10-15  |  1KB  |  56 lines

  1. ' Windows Script Host Sample Script
  2. '
  3. ' ------------------------------------------------------------------------
  4. '               Copyright (C) 1996 Microsoft Corporation
  5. '
  6. ' You have a royalty-free right to use, modify, reproduce and distribute
  7. ' the Sample Application Files (and/or any modified version) in any way
  8. ' you find useful, provided that you agree that Microsoft has no warranty,
  9. ' obligations or liability for any Sample Application Files.
  10. ' ------------------------------------------------------------------------
  11.     
  12.  
  13. Dim oXL
  14. Set oXL = WScript.CreateObject("Excel.Application")
  15.  
  16. oXL.Visible = TRUE
  17.  
  18. oXL.WorkBooks.Add
  19.  
  20. Dim nIndex
  21. nIndex = 1
  22.  
  23. Sub Show(pszDesc, pszValue)
  24.     oXL.Cells(nIndex, 1).Value = pszDesc
  25.     oXL.Cells(nIndex, 2).Value = pszValue
  26.     nIndex = nIndex + 1
  27. End Sub
  28.  
  29. '
  30. ' Put WScript properties
  31. '
  32. Show "Application Friendly Name", WSCript.Name
  33. Show "Application Version", WSCript.Version
  34. Show "Application Context: Fully Qualified Name", WSCript.FullName
  35. Show "Application Context: Path Only", WSCript.Path
  36. Show "State of Interactive Mode", WSCript.Interactive
  37.  
  38.  
  39. Dim oArgs
  40.  
  41. Set oArgs = WScript.Arguments
  42.  
  43. oXL.Cells(nIndex, 1).Value = "argc"
  44. oXL.Cells(nIndex, 2).Value = oArgs.Count
  45. nIndex = nIndex + 1
  46.  
  47. for i = 0 to oArgs.Count - 1
  48.     oXL.Cells(nIndex, 1).Value = "argv[" & CStr(i) & "]"
  49.     oXL.Cells(nIndex, 2).Value = oArgs(i)
  50.     nIndex = nIndex + 1
  51. next
  52.  
  53.  
  54.  
  55.  
  56.