Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

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

5 Replies
erich_shiino
Honored Contributor

Excel Macros

There are some samples in this thread:

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

Not applicable

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

Not applicable

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

satheshreddy
Contributor III

Re: Excel Macros

Hi Suesh,

this macro will work?

Regards

Sathish

dinuwanbr
Contributor III

Re: Excel Macros

Hi,

check this

Macro in Qlikview

Rgds,

Tharindu

Community Browser