Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export/Send to Excel Macro

Hi , I have tried "send to excel" and a macro button to export pivot table to excel.

I realized that the macro button copies the table as in Right Click , CopytoClipBoard > FullTable and pasting in Excel.

sub launchXL
set oXL=CreateObject("Excel.Application")
oXL.visible=True
oXL.Workbooks.Add
aSheetObj=Array("ba0","ba1","ba2","ba3","ba4","ba5","ba6","ba7","ba8","ba9","ba10","ba11","ba12")
for i=0 to UBound(aSheetObj)
oXL.Sheets.Add 
Set oSH = oXL.ActiveSheet
oSH.Range("A1").Select 
Set obj = ActiveDocument.GetSheetObject(aSheetObj(i))
obj.CopyTableToClipboard True
oSH.Paste
sCaption=obj.GetCaption.Name.v
set obj=Nothing 
oSH.Rows("1:1").Select
oXL.Selection.Font.Bold = True 
oSH.Cells.Select
oXL.Selection.Columns.AutoFit
oSH.Range("A1").Select 
oSH.Name=left(sCaption,30) 
set oSH=Nothing 
next
set oXL=Nothing
end sub

I am trying to get a button/macro that does exactly same as the "send to excel" button , which send the data values without any formatting.

Any help on this ?

0 Replies