Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have done a macro which runs correctly in the desktop but it doesn't in the web version.I suppose that I should change the security set up in the server. Does anyone knows a document that gives an introduction to change the server set up?
Thanks in advance,
There are quite a few macro functions that will work in the desktop but will not work in the server.
To grant System Access to a macro on server, the setting is in the QMC Server, Security pane: "Allow unsafe macro execution on server".
-Rob
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?
Sub ws
'Create fixed url
Const HOST = "https://xx.com/xx/cgi-bin/isaweb/me_request.cgi?USER_ID=11&CRC32PWD=2601988992&REQUEST_TYPE=1&SHOT_T..."
'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
xmlhttp.send ""
msgbox("ZIP Descargado")
'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)
s.writeline(xmlhttp.responseText)
ActiveDocument.Variables("request_me").SetContent xmlhttp.responseText,True
APPLICATION.SLEEP(100)
s.Close()
end sub
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?
Hi ,
Check this,
In the server environment, some macros will not work, according to its design. Anyway, there are two points worth noting:
HTH,
Hirish
Rob,
Yes, I am launching the macro from a user button clic.
Thank you for the advise about the DocumentPath.