5 Replies Latest reply: Sep 19, 2017 2:32 AM by Tharindu Ranathunge RSS

    Excel Macros

      Hi, can anyone help me.

       

      I'm looking for a macros code that will enable me to send multiple tables/objects to excel with the click of one button in Qlikview.

       

      Please assist

      Alwyn

        • Excel Macros
          Erich Shiino

          There are some samples in this thread:

          http://community.qlik.com/thread/3563

            • Excel Macros

              Hope this helps:

              We have a button which on click runs the below macro and the chart data is exported to excel.

               

              Sub Export()

              ' Set Excel App
              set XLApp = CreateObject("Excel.Application") ' Define Object
              XLApp.Visible = True 'Visible set as true
              set XLDoc = XLApp.Workbooks.Add 'Open new workbook

              ' Get TB1
              set obj = ActiveDocument.GetSheetObject("CH05")
              ' Copy table and paste into Excel
              set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
              obj.CopyTableToClipboard true 'Copy data to Clipboard
              XLSheet.Paste XLSheet.Range("C1") 'Paste data into cell

              ' Get TB2
              set obj = ActiveDocument.GetSheetObject("CH09")
              ' Copy table and paste into Excel
              set XLSheet = XLDoc.Worksheets(1)
              obj.CopyTableToClipboard true
              XLSheet.Paste XLSheet.Range("A5")

              End Sub

              • Re: Excel Macros

                Hope this helps:

                We have a button which on click runs the below macro and the chart data is exported to excel.

                 

                Sub Export()

                ' Set Excel App
                set XLApp = CreateObject("Excel.Application") ' Define Object
                XLApp.Visible = True 'Visible set as true
                set XLDoc = XLApp.Workbooks.Add 'Open new workbook

                ' Get TB1
                set obj = ActiveDocument.GetSheetObject("CH05")
                ' Copy table and paste into Excel
                set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
                obj.CopyTableToClipboard true 'Copy data to Clipboard
                XLSheet.Paste XLSheet.Range("C1") 'Paste data into cell

                ' Get TB2
                set obj = ActiveDocument.GetSheetObject("CH09")
                ' Copy table and paste into Excel
                set XLSheet = XLDoc.Worksheets(1)
                obj.CopyTableToClipboard true
                XLSheet.Paste XLSheet.Range("A5")

                End Sub

              • Re: Excel Macros
                Tharindu Ranathunge

                Hi,

                check this

                Macro in Qlikview

                Rgds,

                Tharindu