8 Replies Latest reply: May 12, 2017 9:33 AM by Fabio Cavallari RSS

    QlikView Desktop COM Api

    Fabio Cavallari

      I'm developing a C# application that interacts with QlikView Desktop via com.

      Now I would like to be able to open more than one instance of QlikView to perform some operations in parallel.


      Have any of you ever done something like this?



      Thanks in advance

        • Re: QlikView Desktop COM Api
          Lars-Goran Book


          Do you mean QlikView or Qlik Sense Desktop?

          If you are using Qlik Sense see http://help.qlik.com/sense/en-us/developer/

          under Qlik Sense .Net SDK you will find useful informatio / examples.


          Best Regards

          Lars-Göran Book

            • Re: QlikView Desktop COM Api
              Fabio Cavallari


              thanks for reply.


              I mean QlikView... not Sense.

              I cant find any kind of documentation about it.

                • Re: QlikView Desktop COM Api
                  Ingemar Carlo

                  After you install the QlikView Documentation package, available from the download site, the COM API documentation will be in a qvw file here

                  C:\ProgramData\QlikTech\QlikView Documentation\Automation\APIguide.qvw

                    • Re: QlikView Desktop COM Api
                      Fabio Cavallari

                      Hi Carlo,

                      thanks for your reply.

                      I developed my application by following the guidance of the APIguide.qvw document.

                      My problem is that I cant find any documentation about using QlikView Desktop (not Sense) COM object in MTA (multi threaded apartment).

                      The API's behavior suggest that it is an STA (single threaded apartment) COM by default.


                      I'm looking for a way to configure the COM component so that it can be used as MTA.


                      For example... i launch new instance of COM component:


                                         var FirstQVApp = new QlikView.Application();


                      Now I want another instance of QlikView application then I write following code:


                                         var SecondQVApp = new QlikView.Application();

                      But FirstQVApp and SecondQVApp are the same instance of COM component and refer to the same QlikView application instance (same Process ID)!!!

                      It is not enough for me to open two documents like this:

                                     QVApp .OpenDocEx(firstDoc...

                                     QVApp .OpenDocEx(secondDoc...

                      I have to open two instance of QlikView application.

                      Thanks for your patience

                • Re: QlikView Desktop COM Api
                  Fabio Cavallari

                  After a while I found the solution. The method 'RevokeClassObjects' in COM instanced object make QlikView COM MTA (so you can open more that one instance within your COM instance).


                  qlikViewClientCom = Activator.CreateInstance(Type.GetTypeFromCLSID(Guid.Parse(GetQlikViewCLSID())));
                  • Re: QlikView Desktop COM Api
                    Fabio Cavallari

                    I solved it.


                    The COM object method: 'RevokeClassObjects()' make the COM component MTA so you can run all instances of QlikView as your machine can handle.


                    You should call this method before any other call to COM object and after the COM object initialization.