Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
spsrk_84
Creator III
Creator III

Error in Macro code

Hi All,

I am working on QV 10 SR3 (64 bit) Qlikview Desktop .I am facing issue with the below code

Error Message :  Object required: 'ActiveDocument.Variables(...)'

sub GetActiveIndex

Set ContainerObj= ActiveDocument.GetSheetObject("CT30")

Set ContProp=ContainerObj.GetProperties      

vActiveIndex=ContProp.SingleObjectActiveIndex

ActiveDocument.Variables("vActiveIndex").SetContent vActiveIndex, true

msgbox vActiveIndex

End Sub

Please check the code  help to resolve this  issue in this code

Regards,

Shiva

1 Solution

Accepted Solutions
spsrk_84
Creator III
Creator III
Author

The error occured because the variable vActive Index is not created .

View solution in original post

3 Replies
flipside
Partner - Specialist II
Partner - Specialist II

Hi Shiva,

You need to get the variable as well as the object like this example in the API Guide ...

set v = ActiveDocument.GetVariable("Variable1")

v.SetContent "123",true

flipside

spsrk_84
Creator III
Creator III
Author

The error occured because the variable vActive Index is not created .

flipside
Partner - Specialist II
Partner - Specialist II

Of course ... looks like there's two ways to set the variable!  I've gotten into the habit of always getting then setting.

set v = ActiveDocument.Variables("Variable1")

v.SetContent "123",true

flipside