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"
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).
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.
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,
Try this code
Set PPApp = CreateObject("Powerpoint.Application")
PPApp.Visible = True ' Create a presentation
Set PPPres = PPApp.Presentations.Add
Set PPSlide = PPPres.Slides.Add(1, 1)
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
msgbox " PPT MADE"
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
and tick radio button Give system access to module script
hope it helps