Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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