Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Guidok
New Contributor

Export to excel misses headers

Hi,

I've added a export button for exporting some of the tables to excel. This works fine, but the headers are missing.

I've copied the following VSB code from an other post:

sub ExcelExport
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = True
Set xlDoc = objExcel.Workbooks.Add
set obj = ActiveDocument.GetSheetObject("CH02")
obj.CopyTextToClipboard
objExcel.Range("A1").PasteSpecial
xlDoc.SaveAs "C:\Users\xxxx\Desktop\Aanvullen.xlsx"
xlDoc.Close
end sub

What do I need to change to add the headers in the excelsheet?

When I export a table directly to Excel it works fine.

Labels (1)
1 Solution

Accepted Solutions
mwoolf
Honored Contributor II

Re: Export to excel misses headers

Maybe use ".CopyTableToClipboard true" instead of ".CopyTextToClippboard"?

1 Reply
mwoolf
Honored Contributor II

Re: Export to excel misses headers

Maybe use ".CopyTableToClipboard true" instead of ".CopyTextToClippboard"?