Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i create MACRO ?

H?;

i would like to use it for connect to sheet via button, but button and sheet are in different qvw files. As well i can connect to other qvw file via button.
I know i have to do it through macros.

How and where can i create macros?
iwould like to use it for connect to sheet via button, but button and sheet are in different qvw files.

Please help me?

thanks in advance...

1 Solution

Accepted Solutions
Not applicable
Author

OK, so I assume that the problem is that once you have launched an external program (another QVW) the control is with that application and not the application that has called it, therefore creating a further trigger to activate a sheet will not work.

Here's what I'd do:

1. Create some inline data that represents your sheet names or references (I would make these the sheet ID inside the called QVW, this will make your life easier). This table stands alone in your model (i.e. it is not connected to any other table).

2. Add to your trigger (before launching the other qvw) a select on that field, and select the appropriate sheet reference for the QVW you are calling.

3. Make sure that your other qvw has the same inline data table

4. Make sure that you pass the "state" when you call your other qvw (this is an option on the properties of the trigger)

5. In the second qvw, you could then create a trigger on opening the document to active the sheet according to the selected value

I think that should do it for you.

Hope this helps,

View solution in original post

5 Replies
Not applicable
Author

What version of QVW are you using?

What you are asking for is probably much easier in QVW 9.0 because you can use triggers on a button.

Not applicable
Author

hi;

I use 9.0 version.

i try it via triggers but it does not work. i dont know where problem is...

i have to go to specific sheet in other qvw file when i click button...

currently i can go to just one sheet when i click buttons(from a.gvw file to b.qvw file)...

but as you know i would like to use buttons dynamically

ex:
button1(a.qvw) link to sheeta(b.qvw)

button2(a.qvw) link to sheetb(b.qvw)

button3(a.qvw) link to sheetc(b.qvw)

button4(a.qvw) link to sheetd(b.qvw)

button5 (a.qvw) link to sheete(b.qvw)

thanks in advance

Not applicable
Author

OK, so I assume that the problem is that once you have launched an external program (another QVW) the control is with that application and not the application that has called it, therefore creating a further trigger to activate a sheet will not work.

Here's what I'd do:

1. Create some inline data that represents your sheet names or references (I would make these the sheet ID inside the called QVW, this will make your life easier). This table stands alone in your model (i.e. it is not connected to any other table).

2. Add to your trigger (before launching the other qvw) a select on that field, and select the appropriate sheet reference for the QVW you are calling.

3. Make sure that your other qvw has the same inline data table

4. Make sure that you pass the "state" when you call your other qvw (this is an option on the properties of the trigger)

5. In the second qvw, you could then create a trigger on opening the document to active the sheet according to the selected value

I think that should do it for you.

Hope this helps,

Not applicable
Author

Thank you so much Nigel;

you wrote what i need 🙂

Not applicable
Author

Hi Nigel;

perhaps also you can use this code in your other applications
Thanks...



sub xyz()
set app=activedocument.getapplication
set newdoc=app.opendoc("...\b.qvw","","")
newdoc.activatesheetbyid "SH02"
end sub
call xyz()
[\code]

the above code will open the sheet with sheetid "SH 02" in b.qvw
from tauqueer
Thanks... </body>