Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export to excel using script

Hi folks,

i have a script that exports an object to excel.

i want to extend the script functionality to export only first 1000 records from the object.

Script:

SUB SendToExcel

SET chart = ActiveDocument.GetSheetObject("CH01")

SET p = chart.GetProperties

chart.SendToExcel

END SUB

Please advise me how do i can limit the export to 'n' no. of rows.

Thanks in advance.

regards,

Dathu

21 Replies
bimartingo
Contributor III
Contributor III

Hi, to copy the image you'll have to do is use the method CopyImageToClipboard, create the Excel workbook and execute the method paste.

1 - copy the objects image to clipbpoard:

     set obj = ActiveDocument.GetSheetObject( "CH01" )

     obj.CopyImageToClipboard

2 - create the Excel Workbook and paste the image into it:

     Set objExcel = CreateObject("Excel.Application")

     objExcel.Workbooks.Add

     objExcel.Worksheets(1).select()

     objExcel.Visible = True

     objExcel.ActiveWorksheet.Paste

Anonymous
Not applicable
Author

Hi

     Hope the attached file will be helpful for your problem

Regards

Ashok