Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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).
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"
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?
Thanks and best regards,
Chanel
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
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
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
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
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
Hi,
use Control+Shift +M and select the first option
give system access to module script;
and try
hope this helps
Sunil
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