Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
How can we create an new scatter chart in macro by providing Dimensions and Expressions ?
In my current app's i provided two Buttons, first button when i click that it should create a new sheet and in that new sheet scatter chart should create.
And when second button i click then it should delete the recently created scatter chart object and sheet.
Is it possible ?
Thanks in advance.
Regards
Venkat
This is one of eighteen sample scripts from the API Guide:
set chart = ActiveDocument.Activesheet.CreateScatterChart
chart.AddDimension "Customer"
chart.AddDimension "ProductType"
chart.AddExpression "avg(Amount)"
chart.AddExpression "avg(Price)"
cset col = ActiveDocument.GetApplication.GetSolidColorArea(255,0,0) 'red
chart.AddFractLine 0,0,col
set p = chart.GetProperties
set rl = p.ChartProperties.RefLines.Item(0)
rl.Fractile = true
rl.FractileLevel = 50
rl.Legend.v = "median"
rl.Color.PrimaryCol.Col = RGB(255,0,0)
rl.XAxis = true
rl.YAxis = true
chart.SetProperties p
Hi,
when i used your macro i is showing an error Type Mismatch in below line.
cset col = ActiveDocument.GetApplication.GetSolidColorArea(255,0,0)
what i need to change in the above line not get the Type Mismatch error ?
Thanks in advance
Regards
venkat
cset should just be set
You should look at the other 17 sample scripts in the API Guide.