Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
devans_1
Creator
Creator

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)
          else
               TabNames = TabDetails (0)
          end if
     next
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.

0 Replies