Here in qlikview I want to send a pivot table in Excel but in excel its not showing the same formatting as in qlikview .
I'm attaching image and qvw file . Please anyone give me some solution that we can fixed the Issue.
I cannot access the file its corrupted.
But below macro will do the job.
- sub Export
- set XLApp = CreateObject("Excel.Application") ' Define Object
- XLApp.Visible = True 'Visible set as true
- set XLDoc = XLApp.Workbooks.Add 'Open new workbook
- set table = ActiveDocument.GetSheetObject("TB04")
- rem set table = ActiveDocument.GetSheetObject("MB01")
- set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
- table.CopyTableToClipboard true 'Copy data to Clipboard
- XLSheet.Paste XLSheet.Range("A1") 'Paste data into cell
- end sub
Change the object ID's accordingly.
Thanks for the reply but here I'm not able to run this code . when we put the object id of pivot table in place of TB04 then what we should put the id object in place of MB01.
Right-click a cell in the pivot table, and click PivotTable Options. On the Layout & Format tab, in the Format options, remove the check mark from Autofit Column Widths On Update. Add a check mark to Preserve Cell Formatting on Update. Click OK.