Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.

Macro called from script not working - can anyone help ?

I have a macro function that returns the tab names separated by commas.

function TabNames ()

     docprop = Activedocument.GetProperties
     ArrayScript = split(docprop.Script,"///$tab ")

     For i=1 to Ubound (ArrayScript)
          TabDetails = split (ArrayScript(i), chr (13))

          if i > 1 then
               TabNames = TabNames & "," & TabDetails (0)
               TabNames = TabDetails (0)
          end if
end function

This works fine in 'test' mode but it fails when I call it from the script. If I narrow it down:

This works and returns 'Test Worked'


function TabNames ()
    TabNames = "Test worked"
end function

This fails and returns blank

function TabNames ()
     docprop = Activedocument.GetProperties
     TabNames = "Test worked"
end function

So it's the docprop = Activedocument.GetProperties that causes it to fail. Can anyone help ? I am running the macro with system access/allow system access and it still doesn't work.

Community Browser