' Create a Pivot Column Chart (with a filter and series)
' using Vbsedit's free Toolkit

Set pivot = CreateObject("Vbsedit.PivotTable")
pivot.Initialize3,1

folder=Left( WScript.ScriptFullName, InStrRev( WScript.ScriptFullName,"\"))

name=Array("Nancy","Andrew","Janet","Margaret","Steven","Michael","Robert","Laura","Anne")
category=Array("Beverages","Condiments","Confections","Dairy Products","Grains/Cereals","Meat/Poultry","Produce","Seafood")

'Generates 100000 lines of random data
For i=0 to100000
  n = Int((UBound(name) + 1) * Rnd)
  c = Int((UBound(category) + 1) * Rnd)
  pivot.Add name(n),category(c),2005 + Int(12*Rnd),Int(Rnd*10)
Next

pivot.SetColumnNames"Employees","Categories","Year","Sales"

pivot.Finalize

'pivot.SaveToFile folder & "pivot1.piv"

pivot.LoadChartTemplate"column"
pivot.ReplaceTag"title","My Column Chart With Series"
pivot.ReplaceTag"bars","vertical"
pivot.ReplaceTag"stacked","false"
pivot.SaveChart folder & "column2.htm"

Set shell = CreateObject("Wscript.Shell")
shell.Run folder & "column2.htm",1,False



search for scripts

VbsEdit contains all these sample scripts!





Home   Scripts

Copyright © 2001-2019 adersοft