Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
erichshiino
Partner - Master
Partner - Master

There are some samples in this thread:

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

Not applicable
Author

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
Author

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
Creator III
Creator III

Hi Suesh,

this macro will work?

Regards

Sathish

dinuwanbr
Creator III
Creator III

Hi,

check this

Macro in Qlikview

Rgds,

Tharindu