Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i am having a hard time setting a document variable from a VB script.
Depending on whether a container object (Object5) is visible or not, i want to set the value of a document variable (vPurchaseInterval) to 1 or 0.
I was trying to achieve this via VB - maybe there is a better / easier solution.
Here is what i did (...but this did not work...)
Sub setVariable
set obj = ActiveDocument.GetSheetObject("Object5")
set status = ActiveDocument.Variables("vPurchaseInterval")
if obj.IsActive then status.SetContent "1", true else status.SetContent "0", true
End Sub
Can anyone help ?
Thanks in advance!
Hello Kali,
Try the below code.
Sub setVariable
set obj = ActiveDocument.GetSheetObject("CH01")
set status = ActiveDocument.Variables("vset")
if obj.IsActive then status.SetContent "1", true else status.SetContent "0", true
End Sub
How does this differ from what I tried?
I have added a sample QVW - if the chart "CH01" is active (visible), the value of the var vActive should change to 1, otherwise it should be 0.
Hope someone can help!