5 Replies Latest reply: Jan 28, 2016 4:25 AM by Jose Zamarripa RSS

    A macro does't run in the web version

      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,

        • Re: A macro does't run in the web version
          Rob Wunderlich

          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

          • Re: A macro does't run in the web version

            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_TYPE=1&"

             

             

              '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

            • Re: A macro does't run in the web version
              Hirish V

              Hi ,

               

              Check this,


              In the server environment, some macros will not work, according to its design. Anyway, there are two points worth noting:

              1. 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)
              2. If they are creating some filesystem object (such an excel file) make sure you are using the IE Plugin.

               

              HTH,

              Hirish