Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to Minimize/Maximize

I have a button on my sheet that I would like to maximize or minimize based on the selection.

For some reason, it doesn't work. Here is the script

Sub HideApply

set buttonApply = ActiveDocument.GetSheetObject("BU02")

buttonApply.Minimize

End Sub



I even tried having objects on top of another to replicate the hide functionality using the SetLayer method of the button. but that doesnt work either. It comes back saying "Object doesn't support this property or method: 'buttonApply.SetLayer'".

Can anyone help. It looks like these methods are supported according to the API guide.

I am using QV 8.5

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

Try these macros to hide/unhide the button:

Sub HideIt
set BU = ActiveDocument.GetSheetObject("BU01")
set prop=BU.GetProperties
prop.Frame.Show.Always = false
prop.Frame.Show.Expression.v = "1 = 2"
BU.SetProperties prop
End Sub

Sub UnHideIt
set BU = ActiveDocument.GetSheetObject("BU01")
set prop=BU.GetProperties
prop.Frame.Show.Always = true
prop.Frame.Show.Expression.v = ""
BU.SetProperties prop
End Sub

View solution in original post

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Try these macros to hide/unhide the button:

Sub HideIt
set BU = ActiveDocument.GetSheetObject("BU01")
set prop=BU.GetProperties
prop.Frame.Show.Always = false
prop.Frame.Show.Expression.v = "1 = 2"
BU.SetProperties prop
End Sub

Sub UnHideIt
set BU = ActiveDocument.GetSheetObject("BU01")
set prop=BU.GetProperties
prop.Frame.Show.Always = true
prop.Frame.Show.Expression.v = ""
BU.SetProperties prop
End Sub

Not applicable
Author

Rakesh,

Thanks, It works like charm!

If not a pain, Can you tell me why the methods from the API were not working and this was working?