home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / wsh.cab / chart.vbs < prev    next >
Text File  |  1997-09-16  |  2KB  |  61 lines

  1. ' Windows Script Host Sample Script
  2. '
  3. ' ------------------------------------------------------------------------
  4. '               Copyright (C) 1996-1997 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. ' This sample demonstrates how to access Microsoft Excel using the Windows Scripting Host.
  13.  
  14. L_Welcome_MsgBox_Message_Text    = "This script demonstrates how to access Excel using the Windows Scripting Host."
  15. L_Welcome_MsgBox_Title_Text      = "Windows Scripting Host Sample"
  16. Call Welcome()
  17.     
  18. ' ********************************************************************************
  19. ' *
  20. ' * Excel Sample
  21. ' *
  22.  
  23. Dim objXL
  24. Dim objXLchart
  25. Dim intRotate
  26.  
  27. Set objXL = WScript.CreateObject("Excel.Application")
  28. objXL.Workbooks.Add
  29. objXL.Cells(1,1).Value = 5
  30. objXL.Cells(1,2).Value = 10
  31. objXL.Cells(1,3).Value = 15
  32. objXL.Range("A1:C1").Select
  33.  
  34. Set objXLchart = objXL.Charts.Add()
  35. objXL.Visible = True
  36. objXLchart.Type = -4100     
  37.  
  38. For intRotate = 5 To 180 Step 5
  39.     objXLchart.Rotation = intRotate
  40. Next
  41.  
  42. For intRotate = 175 To 0 Step -5
  43.     objXLchart.Rotation = intRotate
  44. Next
  45.  
  46. ' ********************************************************************************
  47. ' *
  48. ' * Welcome
  49. ' *
  50. Sub Welcome()
  51.     Dim intDoIt
  52.  
  53.     intDoIt =  MsgBox(L_Welcome_MsgBox_Message_Text, _
  54.                       vbOKCancel + vbInformation,    _
  55.                       L_Welcome_MsgBox_Title_Text )
  56.     If intDoIt = vbCancel Then
  57.         WScript.Quit
  58.     End If
  59. End Sub
  60.  
  61.