6 Replies Latest reply: Mar 13, 2013 12:31 PM by Jean-Luc Masselin RSS

    Copy container as a picture

      Hello all,


      is it possible to copy a container an all objects in as a picture?


      There is an option, but does'nt seems to work:







        • Re: Copy container as a picture
          Jose Tos

          I never tried it but may be with a macro?


          There are a lot of examples to crear an Excel Application object and copy-paste objects, the next two lines are to get the object container, you need to use the ID of your container "CTXX" and copy the object as bitmap but I´m not sure that this works with a container... you could use with the charts inside the container.


          Set ContainerObj= ActiveDocument.GetSheetObject("CT01") '         

                ContainerObj.CopyBitmapToClipboard true



          hope this helps

          • Re: Copy container as a picture
            Jean-Luc Masselin



            I have the same need and I had the same disappointing discovery of one of the few Qlikview bugs :


            copybitmaptoClipboard does not work on containers !!!


            I work out a turn around this way :


            a: create a button


            b: assign external / macro


            c: use the following code





            sub Container_copy

            Dim obj

            Dim fso


            set obj = ActiveDocument.GetSheetObject("CT03")

            • obj.ExportBitmapToFile "c:\MyImage2.bmp"

            Set objIE = CreateObject("InternetExplorer.Application")

            • objIE.Navigate("c:\MyImage2.bmp")

            Set WShell = CreateObject("WScript.Shell")

            1. WShell.sendkeys "^a^c"

            'WScript.Sleep 250

            1. WShell.SendKeys "%{F4}"

            Set fso = CreateObject("Scripting.FileSystemObject")

            1. fso.DeleteFile("c:\MyImage2.bmp")


            set obj = nothing

            set fso = nothing

            end sub



            This copies container image to a file and then opens the file in MSpaint / select it / copies it to clipboard / close MSpaint / erases the file.





            Hope this helps.



            You can change the end to paste the clipbloard in MS Powerpoint, Word or excel ...