Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
iloveqlik
Contributor
Contributor

Call Qlikview Macro from external VBS

Hi All

I have a short vbs code (outside QVW file ) to run QVW's macro like this below, but i got  wrong message in line 3.

I am not a vbs coder ,  how should I modify it ?

---------------------------------------------------------------------------------------------------------------------------------------------------------

Set m_QvApp = CreateObject("QlikTech.QlikView")

Set m_QvDoc = m_QvApp.OpenDoc ("D:\QVVBS\YTDMTDDTD.qvw")

m_QvApp.FireQvEvent "$button","BU02"    @

3 Replies
marcus_sommer

Try it with:

Set m_QvApp = CreateObject("QlikTech.QlikView")

Set m_QvDoc = m_QvApp.OpenDoc ("D:\QVVBS\YTDMTDDTD.qvw")

m_QvDoc.FireQvEvent "$button","BU02"

or

set doc = ActiveDocument

doc.FireQvEvent "$button","BU02"

- Marcus

iloveqlik
Contributor
Contributor
Author

Hi Marcus

    Thanks, but it won't work, let me send you QVW and vbs file。

Regards,

Joe

marcus_sommer

Yes, the firing of a button seems not work and it might need some further requirements and/or adjustments - whereby I'm not sure if it's in general a smart idea to use VBS to execute any actions fired by a button.

I think if there is already VBS involved it would be more useful to use it for the tasks which are set within the actions, for example to set a variable-value like here:

Set m_QvApp = CreateObject("QlikTech.QlikView")

Set m_QvDoc = m_QvApp.OpenDoc ("D:\QVVBS\YTDMTDDTD.qvw")

m_QvDoc.GetApplication.Refresh

'm_QvDoc.FireQvUserEvent "BU01"

'm_QvDoc.FireQvEvent "$button","BU01"

m_QvDoc.Variables("vShowMessage").SetContent 1, true

and you could do anything like you need with this approach.

- Marcus