Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

neetha_p
Not applicable

Export to PPT Subscript out of range Error

Hi All,

I created Macro to export Qlikview objects to Power Point Presentation, it can export the chart to PPT when I test in module with two objects,but when i try to export with 3rd object its giving error -- Subscript out of range: '[number: 2]'

Sub Export_ppt

Dim myArray(1)

myArray(0) = "LB04"

myArray(1) = "LB06"

myArray(2) = "CH02"

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Add

For count = 0 to ubound(MyArray)

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

ActiveDocument.GetSheetObject(MyArray(count)).CopyBitmapToClipboard

PPSlide.Shapes.Paste

Next

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub

Please any help will be appreciated

Thanks

Nitha

1 Solution

Accepted Solutions
jerem1234
Not applicable

Re: Export to PPT Subscript out of range Error

I think you may have forgotten to change the the array limit:

Dim myArray(2)

Hope this helps!

2 Replies
jerem1234
Not applicable

Re: Export to PPT Subscript out of range Error

I think you may have forgotten to change the the array limit:

Dim myArray(2)

Hope this helps!

neetha_p
Not applicable

Re: Export to PPT Subscript out of range Error

I missed it

Thanks Jerem

Sub Export_ppt

Dim myArray(2)

myArray(0) = "LB04"

myArray(1) = "LB06"

myArray(2) = "CH02"

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Add

For count = 0 to ubound(MyArray)

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

ActiveDocument.GetSheetObject(MyArray(count)).CopyBitmapToClipboard

PPSlide.Shapes.Paste

Next

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub