Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
udaya_kumar
Specialist
Specialist

Export to ppt by looping through all values in listbox

Hi,
i have a listbox with different market names. i have chart in my report.
i am using same chart to refresh for all markets. so i need to export to PPT all these charts at a time.
it should loop through listbox market values one by one and export those charts to PPT on one button click.
how we can do?
i have used one macro, but its not working properly, can anyone check this and tell me what is the problem?
Sub ExportPPT

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True

Set PPPres = PPApp.Presentations.Add
PPApp.Visible = True

ActiveDocument.GetApplication.WaitForIdle

set s=ActiveDocument.Sheets("SH01")
ActiveDocument.Sheets("SH01").Activate
ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.ClearAll False
Activedocument.Fields("PRODUCT_DIM.MARKET_NAME").Clear
Set val=ActiveDocument.Fields("PRODUCT_DIM.MARKET_NAME").GetPossibleValues

PPApp.Visible = True

For i=val.Count-1 to 0 step -1
'Activedocument.Fields("measure2.measure2").Clear
ActiveDocument.Fields("PRODUCT_DIM.MARKET_NAME").Select val.Item(i).Text

Set PPSlide = PPPres.Slides.ADD(1,11)

if val.Item(i).Text="Biologic" then

ActiveDocument.GetSheetObject("CH118").Restore
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetSheetObject("CH118").CopyBitmapToClipboard


elseif val.Item(i).Text="Dermatology" then

ActiveDocument.GetSheetObject("CH118").Restore
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetSheetObject("CH118").CopyBitmapToClipboard


elseif val.Item(i).Text="Gastroenterology" then

ActiveDocument.GetSheetObject("CH118").Restore
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetSheetObject("CH118").CopyBitmapToClipboard


elseif val.Item(i).Text="Rheumatology" then

ActiveDocument.GetSheetObject("CH118").Restore
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetSheetObject("CH118").CopyBitmapToClipboard


elseif val.Item(i).Text="SI Market" then

ActiveDocument.GetSheetObject("CH118").Restore
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetSheetObject("CH118").CopyBitmapToClipboard 
end if 
PPSlide.Shapes.Paste             
ActiveDocument.GetApplication.WaitForIdle
Next

set val=nothing

set PPApp = nothing
set PPPRes = nothing
set PPSlide = nothing



End Sub

Please help me
3 Replies
udaya_kumar
Specialist
Specialist
Author

Hi,
i got it,
its working fine now
the problem was, i was using wrong field so
but am using this code to paste in slide, i want to increase the height of the image in ppt.
i tried this, but the chart is increasing its size based on height and width also increasing with height. so the chart is going beyond the slide.
how can i increase the height of the chart while exporting?
with PPSlide.Shapes.Paste

.Left = 0

.Top = 30

.Width=720

.Height=250

end with
Anonymous
Not applicable

Hi Uday,

I have gone through this post and found that mine requirement is also similar to your's

may  be not that complexity but still I stuck in the middle of requirement .

Where I need  the export the ppt export feature

http://community.qlik.com/thread/138209

could you go through this post and let me know the suggestions

Hoping a kind response from you

udaya_kumar
Specialist
Specialist
Author

Hi John,

Even i don't know much about VB script.

I saw your file, but there is no data in the file, so couldn't check the file.

Sorry for the same.