Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro code to check Show Legend on chart

Hi,

I'm trying to create a macro that would "check" the Show Legend on the presentation tab of my chart (CH28) but my code doesn't seem to work. Thanks in advance for your help!

showlegend.png

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

figured it out...here is the code:

sub SetLegend

set Graph = ActiveDocument.GetSheetObject("CH28")

set p = Graph.GetProperties

set cp = p.ChartProperties

set leg = cp.Legend

if  leg.Show = false then

leg.Show = true

else

leg.Show = false

end if

Graph.SetProperties p

end sub

View solution in original post

1 Reply
Not applicable
Author

figured it out...here is the code:

sub SetLegend

set Graph = ActiveDocument.GetSheetObject("CH28")

set p = Graph.GetProperties

set cp = p.ChartProperties

set leg = cp.Legend

if  leg.Show = false then

leg.Show = true

else

leg.Show = false

end if

Graph.SetProperties p

end sub