Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to export a pivot table to excel with the use of a macro, it works but like others on the forum the dimension ain't right... i want it to be like when you press the export to excel button on the table. It's the same problem here http://community.qlik.com/forums/t/23223.aspx
this is the macro is use:
sub export
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = FALSE
set XLDoc = XLApp.Workbooks.Add
XLDoc.Sheets(1).name = "NBFTE lijst"
set XLSheet = XLDoc.Worksheets(1)
set MyTable = ActiveDocument.GetSheetObject("CH21")
set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
XLSheet.Name="NBFTE lijst"
Mytable.CopyTableToClipboard true 'Copy data to Clipboard
XLSheet.Paste XLSheet.Range("A1")
XLSheet.Cells.EntireColumn.AutoFit
XLSheet.Cells.EntireRow.AutoFit
XLDoc.SaveAs "..\test.xlsx"
XLApp.Visible = False
XLApp.Quit
Set XLApp = Nothing
Set Table = Nothing
end sub
What to i need to add to have the right format??
Thx
set obj = ActiveDocument.GetSheetObject("CH703")
obj.ExportEx "E:\Qlikview\Prima\PPT\Department_Loadinng.xls",5
Hello!
Which version do you use? Since version 9 SR4 there is a bug that do not permit to export correctly a pivot table to excel.
set obj = ActiveDocument.GetSheetObject("CH703")
obj.ExportEx "E:\Qlikview\Prima\PPT\Department_Loadinng.xls",5
thx 🙂