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

Macro is not runnable under QV 9.00

Hi all,

after QV upgrade (8.0 to 9.0) I tried to run some micros in a runnable application without success. For instance if I start the macros in the macro modus I get a message as followed:

Object doesn't support this property or method: 'frame.OnActivateMacro'



The code I am posting that is attached below:

//***************************************

Class ColumnlabelMapping
Dim labelMap
Dim varMap
Dim g
Dim dirty

Private Sub Class_Initialize()
Set labelMap = CreateObject("Scripting.Dictionary")
Set varMap = CreateObject("Scripting.Dictionary")
End Sub


Private Sub Class_Terminate()
labelMap.RemoveAll
End Sub

Private Sub initGraph()
Dim props, exprs, label, frame

Set props = g.GetProperties
Set frame =g.GetFrameDef

'// Lazy Refresh Bug
frame.OnActivateMacro="" '// method's incompatibility in the code
' frame.OnActivateMacro="ActivateGraph"
g.SetFrame frame, false, Array(11)
Set exprs = props.Expressions
Console.debug "initGraph: "&g.GetObjectId&" - "&TypeName(g)
for i = 0 to exprs.Count-1
label=exprs.Item(i).Item(0).Data.ExpressionVisual.Label.v
if(Left(ltrim(label),1)="=") then
label=ActiveDocument.Evaluate(label)
end if
if(not label="") then
Console.debug "adding exsisting label: "&label&" for Graph: "&g.GetObjectId
labelMap.Add label,i
end if
next
End Sub

.....

//***************************************

As I learnt through APIGuid (an VB Object dictionary supplied by QT), this method does not be supported longer through the version 9.0. Has any one idea how can I replace that by another method?

Thanks in advance and best regards,

Wahid

2 Replies
kji
Employee
Employee

Version 9 has shifted from using trigger macros to using trigger actions, old trigger macros should however be translated into the action "Run Macro".

The Frame object now contains an array of actions with the name "OnActivateActionItems".

Not applicable
Author

Hello Johan,

Firstly thank you for your feedback. I modified and completed the error-line by <<< IFrame.OnActivateActionItems="" >>> (of course without angle Parenthesis) as you mentioned and saved the app. After I reopened the application I had to assert that the error was appearing again. Should I proceed from the case that onother method does cause this error?

Best regards,
Wahid