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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing a Variable through a Select Statement in VB Ex. ActiveDocument.Fields("Date").Select("=$(Vdate)")

Hi

When you do a select (Or toggleselect) in a macro) you pass your value as such:

ActiveDocument.Fields("Date").Select("10/2/2010")

But what if i want to pass a variable through there? Like this:

My variable looks like this "vDate = 10/2/2010"

Code (VB):

Sub SelectDate

ActiveDocument.Fields("Date").Select("=$(vDate)")

End Sub

Is this possible, Is there a way around that, without using v9 (Actions), My client is on 8.5.

Thanks,



1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

sorry,

try that:

Sub Sup

set q = ActiveDocument.fields("Year")

set v = ActiveDocument.GetVariable("vMonth")



q.Select v.GetContent.string

End Sub

View solution in original post

3 Replies
sparur
Specialist II
Specialist II

Hello

try that:

set q = ActiveDocument.fields("Date")
set v = q.GetVariable("vDate")

q.Select v.GetContent.string

Not applicable
Author

Sorry but it came back with an error :Object doesn't support this property or method: 'q.GetVariable'"

Sub Sup

set q = ActiveDocument.fields("Year")

set v = q.GetVariable("vMonth")

q.Select v.GetContent.string

End Sub



Please assist.

sparur
Specialist II
Specialist II

sorry,

try that:

Sub Sup

set q = ActiveDocument.fields("Year")

set v = ActiveDocument.GetVariable("vMonth")



q.Select v.GetContent.string

End Sub