Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
fineasfalco
Contributor III
Contributor III

hiding chart title by VB macro

Hi,

I have the need to hide the chart title by a macro.

The layout of the chart title is controlled by check box "Show Caption".

Can I uncheck this control by VB Macro?

I have added a button to run a macro

i.e

SUB ShowHide_TITLE
set chart = ActiveDocument.GetSheetObject("CH29")

set Prop = chart.GetProperties
??? Prop.????=false
chart.SetProperties Prop

end sub

Is there a way for achieving this?

2 Replies
m_woolf
Master II
Master II

This is from the API Guide:

set myobj = ActiveDocument.GetSheetObject("CO01")

prop = myobj.GetProperties

prop.Layout.Frame.ShowCaption = true

myobj.SetProperties prop

m_woolf
Master II
Master II

Since Macros are Bad, I should suggest another method:

You could clone your chart and remove the caption on the close. Then you could use an action to show/hide the charts based on a variable or a field selection.  No macros required.