QlikTip #19: Suppressing Macro-Security (Module Security) Dialog on QlikView-Server/QlikView-Documents

When opening documents with macros the end-user will be shown a dialog to define the desired macro-security/module security (in the QlikView Windows Client or the QlikView IE Plugin):

The module script in this document contains code that accesses the system or applications outside QlikView. What security level do you want to give the macro module of this document.

But what, If you do not want that the end-user has to option to select the desired macro security/module security?
You can (e.g. as a system-administrator) globally enable the module-security at the highest level (“Allow any Macro (only for trusted documents)”) for every QlikView-Server you have by running the following script.
This script adds a registry entry to HKCU\Software\QlikTech\QlikOcx\Settings for Qlikview Servers\:

'// **************************************************
'// Script for adding some registry keys to the current user profile/registry settings
'// for enabling the macro security/module security for the SERVER defined below
'// ~
'// CONFIGURATION
'// Just configure the script by defining your server below
'// ~
'// The article explaining this script can be found at
'// http://www.qlikblog.at/523/
'// **************************************************
CONST cSERVER_NAME = "YOUR_SERVER_NAME"
Dim WshShell 'as Object

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\QlikTech\QlikOcx\Settings for Qlikview Servers\", 1, "REG_SZ"
WshShell.RegWrite "HKCU\Software\QlikTech\QlikOcx\Settings for Qlikview Servers\Module Script System\", 1, "REG_SZ"
WshShell.RegWrite "HKCU\Software\QlikTech\QlikOcx\Settings for Qlikview Servers\Module Script System\ " & cSERVER_NAME, "", "REG_SZ" 

That’s it!
By doing so the end-user will never be asked again to choose the desired macro-security/module security.
You could for example run this script together with other logon scripts, it does not matter if you run this script multiple times!

Possibly related posts:

  1. QlikTip #1: Transferring Current Selections to Excel-Export (translated)
  2. QlikTip #30: How to delete existing QVD files via load-script
  3. QlikTip # 18: A workaround for passing parameters to QlikView-macros
Bookmark and Share

. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

11 Comments

  1. Hector
    Posted January 27, 2010 at 23:21 | Permalink

    Question, about tip #19, do I have to include this script in every single qlikview document I publish in my server?

    Hector

    • Posted January 29, 2010 at 13:08 | Permalink

      Hi Hector,

      no, this is a misunderstanding!!!!
      The script posted in this article is not to be used in QlikView-files!
      This is a script for adding some settings (keys) to the windows-registry!

      Maybe I have not mentioned this clearly in the article:
      You have to save the content in the script to a .vbs-file, then you can execute the file and the keys will be added to the registry.
      Before executing the VBScript-File do not forget to change the constand SERVER_NAME to your server!

      Hope this helps!

      Best regards
      Stefan

  2. Helmut
    Posted February 4, 2010 at 12:41 | Permalink

    Hi Stefan,

    do you also know a way to suppress the dialog when using OCX Clients?
    I seems to me that when using OCX as Client the “Always use this …” Option dosen’t work also.

    Best regards
    Helmut

  3. koff10
    Posted March 1, 2010 at 16:31 | Permalink

    Hi All,
    I’m looking for how do add user and setup security in Qlikview server.
    koff

  4. tylerwaterfall
    Posted April 29, 2010 at 19:21 | Permalink

    Is there a way to undo this setting? A backout plan in case somehow this change to the registry negatively affects the QlikView environment.

    Also, is the effect immediate or is a Server service restart needed?

    Thanks for posting this!
    Tyler

  5. Posted May 3, 2010 at 09:55 | Permalink

    great post as usual!

  6. Corine L
    Posted March 17, 2011 at 14:11 | Permalink

    Hi,
    Our users do not have administrator rights on their machines( no access to regedit). If on the first opening of the document, the user chooses the wrong option, is it possible to reprompt this pop-up that defines the security level of macros?
    Regards,
    CL

    • Posted March 24, 2011 at 21:08 | Permalink

      HI Corine,

      just have a look at the section “User Allowed Security Level” in QlikView’s Reference manual.

      Regards
      Stefan

      • Brian Haas
        Posted March 29, 2011 at 18:06 | Permalink

        Stefan,

        The “User Allowed Security Level” reference in the QlikView Reference manual does not mention any way to change this setting on Access Point (it just tells you how to set it in the Edit Module box of the qvw). If the end user has accidently chosen the wrong setting while using the document through Access Point, is there a way to reset their settings?

        Is there a way to suppress the dialog box on a qvw to qvw basis? We have a macro to export some data to a CSV file in the user’s MyDocuments folder, but if they chose the wrong option from the above dialog box they lose that functionality.

        Thanks,
        Brian

        • Posted March 29, 2011 at 19:03 | Permalink

          Yes, theres is a way to change the security settings: use Control+Shift+M to access the module security dialog.

          For all combination and dependencies of settings influencing the security dialog I’ll prepare an article with some details …

          Regards
          Stefan

    • Posted March 29, 2011 at 19:01 | Permalink

      What’s just about using this script as a windows logon script with other security permissions than the current user; that’s really the purpose of this article.

      Regards
      Stefan

Post a Comment

(required)
(required)

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting