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

Calling VBScript/JScript macro from loadscript hangs QV?

Hi All!

I've been trying to call the following JScript macro from the load script using a LET statement, but every time I try it hangs QlikView:

[CODE]

function exportXML () { var fn= ActiveDocument.GetProperties().MyWorkingDirectory + "\\questions.xml" ; ActiveDocument.GetField("xml") . ServerSideExportEx(fn,".",1,0,false) ; var fo=(new ActiveXObject("Scripting.FileSystemObject")) . GetFile (fn) ; rf=fo . OpenAsTextStream(1,0) ; nt=rf . ReadAll() . replace(/""""/g,""" """) // Change correct "" to " " . replace(/""/g,""") . replace(/" "/g, """") // Change all "" to " then correct " " to "" . replace(/"\<\?/g,"<?") . replace(/ "[\n\r]+/g, "") // Remove record quotations ; rf . Close() ; wf= fo . OpenAsTextStream(2,0) ; wf . Write (nt) ; wf . Close() ; return 0}

[/CODE]

When I call the Macro from within the Edit Module dialog it does exactly what I need it to. Why is it hanging when called from the load script?

Thanks in advance!

Alex

0 Replies