Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT: Upcoming LEF Database Maintenance, Oct. 3rd - SEE DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Macro to run a button

Hi All,

I'm trying to write a macro that 'clicks' a button. The reason for this is the button links to another application and transfers state, and from my knowledge there is no way to get a macro to transfer state.

Therefore if I can get a macro that simply 'clicks' on the button, by activating it or simulating an actual click on that button then I think it would work. I have however been unable to find any macro/function that does this and am wondering if anyone has come across something similar.

Many thanks for any help,

Jeremy

1 Solution

Accepted Solutions
Highlighted
Master II
Master II

From the API guide:

ActiveDocument.GetSheetObject("BU01").Press

View solution in original post

17 Replies
Highlighted
Master II
Master II

From the API guide:

ActiveDocument.GetSheetObject("BU01").Press

View solution in original post

Highlighted
Not applicable

Thank you very much!

Looked all over Google, but I really should start looking in the API guide...

Thanks again,

Jeremy

Highlighted
Partner
Partner

Hi ,

Is there any syntax.for this macro for pressing a button on opening the sheet,I am trying to run this but its not working in my case. I have attached a sample for your reference.Could you kindly have a look when you have a chance?

What I am looking is for the button to get activated  and clear the selections in my field when I open the application.

Thanks,

Kiruthiga

Highlighted

Hi Kiruthigadevi,

Why do you want use macros for this simple task? You can inbuilt functionalities to clear the field.

Capture.PNG

Highlighted
Partner
Partner

Hello Tamil,

Thanks for your time. I am trying to avoid this  feature as it is not working in the ajax mode.

Thanks,

Kiruthiga

Highlighted

Please note that Macros might not work in AJAX client. You need to use OnOpen trigger option for both the cases (clear field or running a macro). Please see Bill's reply in the below thread. 

AJAX with OnOpen macro

Highlighted
Partner
Partner

Actually we are migrating an application from IEPlugin to Ajax mode. The problem is  on activatesheet and onleavesheet triggers are not working in ajax mode but they are working in the IEPlugin. So I am looking for some solution.

This button click is the one I found as an alternative. Is there any other alternatives do you suggest?

Thanks,

Kiruthiga

Highlighted

Hello Kiruthiga,


I am not sure but you can create a bookmark for the values that you want to set on open of a qlikview document or whatever the required layout state. Then create an OnOpen trigger action and use apply bookmark feature. Document Properties =>Triggers => OnOpen => Add Actions => Bookmark => Apply Bookmark => Type the bookmark ID => Press Apply => Click Ok. I think this should work but I haven't tried yet.


Good luck.

Highlighted
Partner
Partner

Hello Tamil,

Thanks for your reply. I created a bookmark but OnActiveSheet is not working for BookMarks as well in Ajax.

Thank you,

Kiruthiga