Thank you, Rob!
My code is the following, do you know if is something in there that is not helping to run in in web?
'Create fixed url
'Obtain dynamic url
set fld = ActiveDocument.GetField("generated_url")
me_url = ActiveDocument.Evaluate("trim(generated_url)") ' Get selection
'Create the xmlhttp object
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
'Call HTTP with the method "GET" enviando url generado
xmlhttp.Open "GET", HOST & me_url, true
'Create temporal file to save the xml
Path = ActiveDocument.Evaluate("left(DocumentPath(), index(DocumentPath(), '\', -1))")
' FileName = Path & "XMLOutput.xml"
FileName = "XMLOutput.xml"
set fso = CreateObject("Scripting.FileSystemObject")
set s = fso.CreateTextFile(FileName, True)
Thank you in advance
You will need System Access for this macro, so you will need to set the "Allow unsafe macro execution on server" in QMC.
I've never tried to write to the filesystem from a server macro, so I don't know if that will work. Perhaps someone else can confirm.
I can see at least one problem. On the server, "DocumentPath()" returns the document URL, not a filepath.
Are you launching this macro from a user button click?
In the server environment, some macros will not work, according to its design. Anyway, there are two points worth noting:
- Make sure you are granting System Access to your macros in the server through QEMC (System, Setup, QlikView Servers, expand and click, Seucrity tab in the right pane "Allow unsafe macro execution on server" and "Allow macro execution on server" ticked) and in the Macro editor, (Ctrl + M, bottom left drop downs)
- If they are creating some filesystem object (such an excel file) make sure you are using the IE Plugin.