Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
nsardaryan
New Contributor

Pass current selections to another QVW file by macro

Hi all!

I have a problem with a passing current selections from Doc1 to Doc2 QVW file by macro.

This is my problem macro:

Sub OpenDoc


set x = ActiveDocument.GetCurrentSelections

s = x.Selections

v = x.VarId

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc ("Doc2.qvw","","")

for i = lbound(s) to ubound(s)

    MyDoc.Fields(v(i)).Select s(i)

next

End Sub

My documents include the same type of fields with the same names

Please provide me with information why this macro doesn't work and where I did a mistake

2 Replies
datanibbler
Esteemed Contributor

Re: Pass current selections to another QVW file by macro

Hi,

I'm not good at macros - I don't know VB - but you can pass a selection from one doc  to another without a macro when you use document_chaining. There's a checkbox. Why wouldn't that work for you?

Best regards,

DataNibbler

nsardaryan
New Contributor

Re: Pass current selections to another QVW file by macro

Hi,
Can you provide me with more information about document_chaining? If you mean this functionalityhttp://community.qlik.com/thread/53743 it doesn't help us because we will work only with QlikView's clients and not server. Our main goal is to open new document, activate special sheet and pass current selection to the same objects in it. I think macros is the best way to do this functionality with the maximum control and expansion of functionality