Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

export to excel two sheets

I have a container that contains two tables : CH10001 and CH10002

with the following code I can export CH10001

sub xport2xl()

iRow = 1

set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True

set xlWB = xlApp.Workbooks.Add

set xlSheet = xlWB.Worksheets(1)

set obj = ActiveDocument.getsheetobject(ChartName)

xlSheet.Activate

xlSheet.Cells.Clear

while not (isempty(xlSheet.Cells(iRow,1)))

iRow = iRow+2

wend

set txt1 = ActiveDocument.GetSheetObject("CH10001")

txt1.CopytableToClipboard TRUE

xlSheet.Cells(iRow,1).Select

xlSheet.Paste

end sub

How can I export CH10001 and CH10002 in the same workbook but with dynamic sheet name ? add the getdate in the name of the sheet for example ?

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this blog post: http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/


talk is cheap, supply exceeds demand