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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clear Input Boxes

I'm trying to clear all of the input box items in the attached *.qvw using VB script and the "Clear Input Values" button. For some reason my code is only clearing out the top two items. Anyone know what I'm missing to clear all of the items out?

thanks,

rob

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

Hi Rob,

Try following:

sub input_clr
'Clear All input boxes
set ClearAllib = ActiveDocument.GetSheetObject("IB01")
for i = 1 to ClearAllib.GetNoOfRows
ClearAllib.SetVariableContent i-1,"",true
next
end sub

Thanks

View solution in original post

5 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Hi Rob,

Try following:

sub input_clr
'Clear All input boxes
set ClearAllib = ActiveDocument.GetSheetObject("IB01")
for i = 1 to ClearAllib.GetNoOfRows
ClearAllib.SetVariableContent i-1,"",true
next
end sub

Thanks

Not applicable
Author

Do you not just need it to be:













sub




input_clr
'Clear All input boxes

set



ClearAllib = ActiveDocument.GetSheetObject("IB01"
)
""

,
true
""

,true
""


,true
""


,true
""


,true

' ActiveDocument.ClearAll false
end



Regards,

Gordon

sub











Not applicable
Author

That came out well! Should have read:

sub input_clr
'Clear All input boxes
set ClearAllib = ActiveDocument.GetSheetObject("IB01")
ClearAllib.SetVariableContent 0,"",true
ClearAllib.SetVariableContent 1,"",true
ClearAllib.SetVariableContent 2,"",true
ClearAllib.SetVariableContent 3,"",true
ClearAllib.SetVariableContent 4,"",true
' ActiveDocument.ClearAll false
end sub

Not applicable
Author

Thanks Rakesh. That did the trick.

rob

Not applicable
Author

Gordon,

That also worked. Thanks.

rob