Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have created a varible to store the value selected in the listbox.
what i am trying to do is to check if variable is not blank then chnage chart style to pie and if its blank change chart style to pie
sub SetChartType
set chart = ActiveDocument.GetSheetObject("CH01")
intObjectType = chart.GetObjectType
if intObjectType = 15 then 'is currently a line chart
chart.SetChartType 2
else
chart.SetChartType 4
end if
end sub
just replace the fixed values with your variable. this code is copied from some earlier discussion which unfortunately I cannot find at the moment...
Of course you can always use Fast Type Change from the chart properties instead of a macro...
sub SetChartType
set chart = ActiveDocument.GetSheetObject("CH01")
intObjectType = chart.GetObjectType
if intObjectType = 15 then 'is currently a line chart
chart.SetChartType 2
else
chart.SetChartType 4
end if
end sub
just replace the fixed values with your variable. this code is copied from some earlier discussion which unfortunately I cannot find at the moment...
Of course you can always use Fast Type Change from the chart properties instead of a macro...
How about creating two different objects (chart and a pie) and using a conditional calc and show based on the variable value?