Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shantanu73
Creator II
Creator II

Detach Function how to get run from macro

Hello Friend's/Master's,

I can activate the Detach property on Chat/Graph by keyboard which is working fine.

But I want to activate it by scripting/Macro on any Button for particualar Chat/Graph.

The following Macro Code I had written in the one of the Button as follows:-

 

Sub R_Chart
set obj = ActiveDocument.GetSheetObject("CH03")
obj.Detach
End Sub

 

Sub UR_Chart
set obj = ActiveDocument.GetSheetObject("CH03")
obj.Attach
End Sub

After running the Macro when I checking the properties by keyboard on Chat/Graph it is showing proper. But It does'nt act accordingly.

I hope I had able to explain the scenario.

It will great if any body can help me out for solving the above problem.

Thanks in Advance

Shantanu

4 Replies
Not applicable

Hi Shantanu,

     I tried your macro. Its working fine. What are you expecting? Please elaborate.

Regards,

Anju

shantanu73
Creator II
Creator II
Author

Hello Anju,

Thanks for response. And Sorry about the  scenario example which I had given about the calling the Macro on Button. I thought that it will not work in Button. But it is working. Basically it doesn't work following scenario as follows:-

1. Suppose I had taken one object as List box by binding the column Country_name.

2. And Second as Chart/Graph object.

3. Now, (In Setting->Document Properties->Triggers->Field Event Triggers) at column Country_name OnSelect(Add Actions) I add/Call Macro R_Chart. Here Macro Get Excuted. Because when I check the properties by keyboard on Chat/Graph it is showing proper. But It does'nt act accordingly.

Same Way OnChanges(Add Actions) I add/Call Macro UR_Chart. Here also Macro Get Excuted. Because when I check the properties by keyboard on Chat/Graph it is showing proper. But It does'nt act accordingly.

I hope I had able to explain the scenario. Can u please check now and given solution to me.

Thanks in Advance

Shantanu

Not applicable

Hi Shantanu,

I tried it. Its working. First , we have to understand the functionality of 'OnSelect' and 'OnChange'.

This is what the document says

"OnSelect

The action will be executed each time a selection has been

made in the specified field.

OnChange

The action will be executed each time a selection has been

made in any field which is logically associated with the

specified field."

So, I guess 'OnChange' will not work for selections on countryname.

I have also attached a file where I have used your macro .

Hope it is helpful!

Regards,

Anju

shantanu73
Creator II
Creator II
Author

Hello Anju,

Thank for quick respons.

I had checked TRIAL.qvw file which is working fine. But I will soon back with QVW file where I facing the problem.

Then I hope U will understand the problem.

Thanks

Shantanu