Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export Pivot Table to Excel

Hi,

I have the ffg macro that exports two pivot tables and works :

sub sendExcel

          set XLApp = CreateObject("Excel.Application")

          XLApp.Visible = FALSE

          set XLDoc = XLApp.Workbooks.Add

          XLDoc.Sheets(1).name = "By FundCode"

          set XLSheet = XLDoc.Worksheets(1)

          set MyTable = ActiveDocument.GetSheetObject("CH05")

          set XLSheet = XLDoc.Worksheets(1)

          MyTable.CopyTableToClipboard true

          XLSheet.Paste XLSheet.Range("A1")

          set MyTable = ActiveDocument.GetSheetObject("CH04")

          MyTable.CopyTableToClipboard true

          XLSheet.Paste XLSheet.Range("H1")

          XLDoc.SaveAs "Decalog.xls"

          XLApp.Visible = False

          XLApp.Quit

          Set XLApp = Nothing

          Set Table = Nothing

end sub


I am also trying to export 2 more pivot tables into the same excel workbook but into different sheets, I have tried for hours to crack this but can't seem to get it right....

Any help will be appreciated...

Regards

Razak

0 Replies