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 ?