Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Export to PPT

Hi Community,

I created button to run macro, it can export the chart to PPT when I test in module.

But it is not functioning when I clicked the button on dashboard. Anyone has solution?

Code:

Sub ppt

Dim myArray(9)

myArray(0) = "CH393"

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Add

For each item in myArray

Set PPSlide = objPresentation.Slides.Add(1,11)

ActiveDocument.GetSheetObject(item).CopyBitmapToClipboard

PPSlide.Shapes.Paste

Next

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub

Thanks and best regards,

csy

Tags (2)
1 Solution

Accepted Solutions
Employee
Employee

Re: Export to PPT

1. which is the behaviour when you click the button?

2. try this:

a. save the qvw

b. close the qvw

c. open the qvw again and allow macro execution

d. click the button

3. did you add an action to the button (mouse dx\properties\actions tab\click on add button and select the "external" action type\choose the run macro action and write the correct macro name).

19 Replies
Employee
Employee

Re: Export to PPT

Hi,

1. For each ... next is not supported. Use For count = 0 to ubound(MyArray)...next

2. you declared MyArray with 9 elements, you configured only the first ( MyArray(0) ), then you cycled through all elements....it's not correct.

See the Automation Reference Manual for "VB keywords and functions not supported by VBScript"

Not applicable

Re: Export to PPT

Hi Andrea,

Thanks for your guidance, I am new to VB actually. I tried to edit the code and run, seems like it is not working to paste the sheet object to power point. May I know where is going wrong?

pic.PNG.png

Thanks and best regards,

Chanel

rajeshvaswani77
Valued Contributor III

Re: Export to PPT

Hi Chanel,

The most easiest way to do this is, go to last tab caption and select "Copy image to clipboard". You will get one icon on the chart on the top right side. The user has to just click this and then go to PPT and paste the chart. Macro would cause many dependencies, it may cease to work sometimes on AJAX client.

thanks,

Rajesh Vaswani

Not applicable

Re: Export to PPT

Hi Rajesh,

Really appreciated your reply, but actually what client requests is export the whole sheet to one slide of PPT, which I think is pretty hard, because sometimes the sheet is longer than actual resolution in image.

And we have many charts in one sheet and around 10 sheets on the dashboard, client might not like to copy paste the chart one by one for 50++ charts...

Thanks and best regards,

Chanel

rajeshvaswani77
Valued Contributor III

Re: Export to PPT

Please have a look at Reports Menu Item of QlikView Desktop. This functionality could be helpful to you. Truly speaking, have not used it myself.

thanks,

Rajesh Vaswani

er_mohit
Honored Contributor II

Re: Export to PPT

Try this code

sub ppt

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True ' Create a presentation

Set PPPres = PPApp.Presentations.Add

Set PPSlide = PPPres.Slides.Add(1, 1)

ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard

PPSlide.Shapes.Paste

PPPres.SaveAs "E:\Qlikview\Prima\PPT\Presentation.ppt"

PPPres.Close

PPApp.Quit

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

msgbox " PPT MADE"

end sub

replace with your chart object id

and make sure in macro means ctrl+m

On Left side below

Request Module Security-->System access

Current local security-->System access

and on dashboard side

press ctrl+shift+m

and tick radio button Give system access to module script

hope it helps

Not applicable

Re: Export to PPT

Hi,

This is working when i tested in module, but it is not functioning when i tried to click on the button object.

May I know why?

Thanks and best regards,

Chanel

chauhans85
Esteemed Contributor

Re: Export to PPT


Hi,

use Control+Shift +M and select the first option

give  system access to module script;

and try

hope this helps

Sunil

Not applicable

Re: Export to PPT

Hi Sunil,

I tried this step as it is mentioned in Mohit Shama's post but it doesn't work.

I am wondering what is happen to that button?

Thanks and best regards,

Chanel

Community Browser