Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I think you may have forgotten to change the the array limit:
Dim myArray(2)
Hope this helps!
I think you may have forgotten to change the the array limit:
Dim myArray(2)
Hope this helps!
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