' Create a Pivot Column Chart (with a filter)
' using Vbsedit's free Toolkit
Set pivot = CreateObject("Vbsedit.PivotTable")
pivot.Initialize 2,2
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 to 100000
n = Int((UBound(name) + 1) * Rnd)
c = Int((UBound(category) + 1) * Rnd)
pivot.Add name(n),category(c),1,Int(Rnd*100)
Next
pivot.SetColumnNames "Employees","Categories","Number of orders","Sales"
pivot.Finalize
pivot.LoadChartTemplate "column"
pivot.ReplaceTag "title","My Column Chart With a Filter"
pivot.ReplaceTag "bars","vertical"
pivot.ReplaceTag "stacked","false"
pivot.SaveChart folder & "column1.htm"
Set shell = CreateObject("Wscript.Shell")
shell.Run folder & "column1.htm",1,False