Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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?