Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Re : Export Data to Excel in Different Sheet

Hi I have an application, where 2 Straight Table. I want to export the both straight table data in Single Excel but in sheet1 and Sheet 2.

Macro is working but it is not exporting CH01 object data, In both sheet CH02 data is coming.

Below is my code :

Sub ExcelFile

DIM ExcelApplication, ExcelWorkbook

SET ExcelApplication = CREATEOBJECT("Excel.Application")

SET ExcelWorkbook = ExcelApplication.Workbooks.Add
SET MyExcelApp = Nothing
ActiveDocument.GetSheetObject("CH01").CopyTableToClipBoard TRUE
ActiveDocument.GetSheetObject("CH02").CopyTableToClipBoard TRUE

ExcelWorkbook.Worksheets(1).Paste
ExcelWorkbook.Worksheets(2).Paste

ExcelApplication.DisplayAlerts = FALSE

ExcelWorkbook.SaveAs "C:\Users\User\Downloads\test.xls",56

ExcelApplication.Quit

MsgBox "Export Complete"

End Sub

 

I am also attaching my QVW.

Please do the needful. Thanks in advance.

Regards,

AK

Labels (1)
0 Replies