Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
luciancotea
Specialist
Specialist

As I said: because the SendToExcel function cant limit the no of rows, you have to tweak your expressions to show only 1000 rows.

Anonymous
Not applicable
Author

sub limitRow

set chart = ActiveDocument.GetSheetObject("CH02")

'set chart = ActiveDocument.Activesheet.CreateStraightTable

'tb.AddField "Member"

set cp = chart.GetProperties

cp.TableProperties.MaxNumShown.v = 1000          

chart.SetProperties cp

SET p = chart.GetProperties

chart.SendToExcel

end sub

Not applicable
Author

Hi Sarathi,

Thanks for your reply. I got only 100 rows when i am using above script in the Macro.

I think, in the straight table the max number is limited to 1-100 in the presentaion tab. I am using QV10.

Please suggest me how to overcome this.

Thanks in advance.......

Regards,

Siri

Not applicable
Author

Using this script we can export only first 1000 rows from a chart even the chart displaying more than 1000.

udaya_kumar
Specialist
Specialist

hi,

i want to export qlikview charts as an image to excel, not as a data in excel.

how we can do that?

Anonymous
Not applicable
Author

copy to clipboard then paste ..it act as a object

udaya_kumar
Specialist
Specialist

but i want to export chart on button click in qlikview

Anonymous
Not applicable
Author

ActiveDocument.Sheets("Main").ExportBitmapToFile "C:\MyImage.bmp"

or

ActiveDocument.GetSheetObject("LB02").ExportBitmapToFile "C:\MyImage.bmp"

udaya_kumar
Specialist
Specialist

thanks for reply sarathi,

but i want to export that chart to powerpoint from qlikview on button click.

udaya_kumar
Specialist
Specialist

sorry i want to export to excel from qlikview on button click as an image.