Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have Pivot table Data ,how to Export Excel using Button.
Thankls
No need for a button, just right-click the chart and select "Send to Excel" or export.
Hi
1 Option
MACRO:
Sub Export_Pivot
Set Chart = ActiveDocument.GetSheetObject("CH02")
Set P = Chart.GetProperties
Chart.SendToExcel
End Sub
*** Actions Button
I tried it's not working , my script like below
sub Export_Stright
set chart = ActiveDocument.GetsheetObject("CH02");
set p = Chart.GetProperties;
set Chart.SendToExcel;
ENDSUB
TestData1:
LOAD
[Date],
[Client Name],
[ Type],
Replace(Replace(Replace(Replace(Replace(Replace(Replace( Type ,'GRP','Group Meeting'),'CCL','Conference Call'),'DINNER','Dinner'),'LUNCH','Lunch'),'BREAKFAST','Breakfast'),'GBR','Break'),'DINE','Dinner') as [Meeting Type Code],
Title,
Contact,
Status
Resident testData;
Drop table testData;
*** Actions Button
I fallow the above steps in Button..
Hi,
have you tried with attached method?
also take a look on Stephen Solution
QlikTip #32: Exporting multiple QV objects to a single Excel document
HI ,
Please try below code
Sub ExcelExport
'Set the path where the excel will be saved
filePath = "D:\Test.xlsx"
'Create the Excel spreadsheet
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
'Create the WorkBook
Set WorkBook = excelFile.WorkBooks.Add
'Create the Sheet
Set Sheet = WorkBook.WorkSheets(1)
'Get the chart we want to export
Set tableToExport = ActiveDocument.GetSheetObject("CH04")
Set chartProperties = tableToExport.GetProperties
tableToExport.CopyTableToClipboard true
'Get the caption
chartCaption = tableToExport.GetCaption.Name.v
'MsgBox chartCaption
'Set the first cell with the caption
Sheet.Range("A1") = chartCaption
'Paste the rest of the chart
Sheet.Paste Sheet.Range("A2")
excelFile.Visible = true
'Save the file and quit excel
WorkBook.SaveAs filePath
WorkBook.Close
excelFile.Quit
'Cleanup
Set WorkBook = nothing
Set excelFile = nothing
End Sub
Hi
I am getting empty excel sheet. can you guide me how to get into excel
i tried below logic
Sub ExcelExport
'Set the path where the excel will be saved
filePath = "\C:\Developer\Qlikview\Data.xlsx"
'Create the Excel spreadsheet
Set excelFile = CreateObject("Excel.Application")
excelFile.Visible = true
'Create the WorkBook
Set WorkBook = excelFile.WorkBooks.Add
'Create the Sheet
Set Sheet = WorkBook.WorkSheets(1)
'Get the chart we want to export
Set tableToExport = ActiveDocument.GetSheetObject("CH02")
Set chartProperties = StrighttableToExport.GetProperties
StrighttableToExport.CopyTableToClipboard true
'Get the caption
chartCaption = tableToExport.GetCaption.Name.v
'MsgBox chartCaption
'Set the first cell with the caption
Sheet.Range("CH02") = chartCaption
'Paste the rest of the chart
Sheet.Paste Sheet.Range("CH02")
excelFile.Visible = true
'Save the file and quit excel
WorkBook.SaveAs filePath
WorkBook.Close
excelFile.Quit
'Cleanup
Set WorkBook = nothing
Set excelFile = nothing
End Sub
Code working as expected don`t know what exactly the issue is,
please share you application
Hi,
Thank you so much!!!!
It's working good .
Thanks