Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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" @
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
Hi Marcus
Thanks, but it won't work, let me send you QVW and vbs file。
Regards,
Joe
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