Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using Variables in GetContent

Hi

I have onve variable vSQL, this is set in a button and looks like:

= 'EXEC master.dbo.xp_AnalogWideHistory ' & vBatchStartTime & ', ' & vBatchStopTime & ', ' & 100000 & ', ' & vTag

The button then run a macro where I try to use this in EDX

SET SQL = ActiveDocument.Variables(vSQL)

(...)

GetEDXRequestString = "<Global method=""RequestEDX"" key=""" & strRequestKey &  """><i_TaskIDOrTaskName>" & strTaskName & "</i_TaskIDOrTaskName><i_Password>" & strTaskPassword & "</i_Password><i_VariableName >vSQL</i_VariableName ><i_VariableValueList ><string>" & SQL.GetContent.String & "</string></i_VariableValueList ></Global>"

When I run the macro I get the following error:

Object required: 'SQL'

and it then highlights the last part of the GetEDXRequestString mentioned above.

What am I doing wrong?

Dan

11 Replies
Anonymous
Not applicable
Author

Thanks.

The code stores the vSQL value.

I f I now get to solve the problem of actually running it I would be home free.

Anonymous
Not applicable
Author

Maybe you know why this happends:

In the last line I add varSQL

GetEDXRequestString = "<Global method=""RequestEDX"" key=""" & strRequestKey &  """><i_TaskIDOrTaskName>" & strTaskName & "</i_TaskIDOrTaskName><i_Password>" & strTaskPassword & "</i_Password><i_VariableName >varSQL</i_VariableName ><i_VariableValueList ><string>" & varSQL.GetContent.String & "</string></i_VariableValueList ></Global>"

This gives an error: Object required: 'varSQL'

Why?

I tried to add ActiveDocument.Reload at the bottom.

When running from server this works just fine, running from client does not work.

So it seems that what I need to make happend is that the edx should eb able to reload the document somehow.

Dan