Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

passing credentials of section access using macro

Hello

I got a document that binary reads from another document that has section access

Now I don't want users who open the first document to supply a user name and password

is there a way to pass the userName and password using a macro on the OnOpen trigger

I can walk on water when it freezes
3 Replies
Not applicable

Try something like the following.

Stephen

rem ** VBScript **
set App = ActiveDocument.GetApplication
App.OpenDoc "C:\MyDocuments\Budget.qvw","user",false,"jnn","123456",""

rem ** Visual Basic **
dim App as New QlikView.Application
set newdoc = App.OpenDoc ("C:\MyDocuments\Budget.qvw","admin",false,"jnn","123456","")

Not applicable

I think I missunderstood your question. You want to "automatically" pass the userName and password, so my code above is not what you want.

flipside
Partner - Specialist II
Partner - Specialist II

If you are wanting to grant users access to the second (Reader) document but prevent access to the first (Source) document, you can just define a new Section Access in the second document to replace the original security.

If the security needs to be cumulative, then to pass the security from Source to Reader, you would need to do the following (although this might be considered a security issue) ...

In the source document pass the security into hidden fields as thus ...

set HidePrefix='^^^' ;

Section Access;
SecTable:
LOAD * INLINE [
    ACCESS, USERID, PASSWORD
    admin, user1, pwd1
    admin, user2, pwd2
];


Section Application;

Security:
LOAD
ACCESS AS ^^^ACCESS,
USERID AS ^^^USERID,
PASSWORD AS ^^^PASSWORD
resident SecTable;

In the Reader document ...

     binary SecDoc1.qvw;

     Section Access;
     LOAD
           ^^^ACCESS as ACCESS,
           ^^^USERID AS USERID,
           ^^^PASSWORD AS PASSWORD
     RESIDENT Security;

     LOAD * INLINE [
         ACCESS, USERID, PASSWORD
         user, user3, pwd3
     ];

Section Application;
     DROP TABLE Security;

You would need to integrate NTNAME into the security to automatically allow users into the documents.

flipside