Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Colleagues, good day!
My model has macro which export charts to new power point presentation.
Tell me please, is there in qv macro ability to export objects into ppt template (not creating new presentation) ?
There're test model and necessary ppt template in attachment.
Thanks.
Hi,
Sub ExportPPT
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.open("YourPath\ppt.pptx")'file Path
Set PPSlide = objPresentation.Slides.Add(1,12)
ActiveDocument.GetSheetObject("CH02").CopyBitmapToClipboard
PPSlide.Shapes.Paste
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 150 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 15 'This sets the left location
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 240
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 250
Set PPSlide = objPresentation.Slides.Add(1,12)
ActiveDocument.GetSheetObject("CH02").CopyBitmapToClipboard
PPSlide.Shapes.Paste
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 150 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 15 'This sets the left location
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 100
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 200
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
End Sub
Thanks,
Hirish
Well there is nothing stopping you from storing the PowerPoint presentation as a POTX-file (PowerPoint Template). You can either do it manually with File Save As and select it or you can do it directly in your macro. The PowerPoint object model supports that by using the method SaveAs on the presentation object.
Thanks!
My answer was - how i can export objects directly by macro???
Hi andrey try this:
Sub ExportPPT_1
 Set objPPT = CreateObject("PowerPoint.Application")
 objPPT.Visible = True
 Set objPresentation = objPPT.Presentations.Add
 Set PPSlide = objPresentation.Slides.Add(1,11)
 
 set up = ActiveDocument.GetApplication.GetUserPreferences 
 up.ChartUseCapNBorder = True
 ActiveDocument.GetApplication.SetUserPreferences up
 
 
 with objPresentation.Slides(1).Shapes(1)
 .TextFrame.TextRange = "Test für PowerPoint Seite 1"
 .Left = 100
 .top = 15
 .width=500
 .height=20
 end with 
 
 ActiveDocument.Sheets("SH01").Activate 
 
 ActiveDocument.GetSheetObject("TX01").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.PasteSpecial(PasteHTML)
 .Left = 100
 .top = 45
 .width=100
 .height=160
 end with 
 ActiveDocument.GetSheetObject("TX02").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 100
 .top = 200
 .width=100
 .height=160
 end with 
 ActiveDocument.GetSheetObject("TX03").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 100
 .top = 355
 .width=100
 .height=160
 end with
 ActiveDocument.GetSheetObject("TX04").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 400
 .top = 45
 .width=100
 .height=160
 end with
 
 ActiveDocument.GetSheetObject("TX05").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 400
 .top = 200
 .width=100
 .height=160
 end with 
 
 ActiveDocument.GetSheetObject("TX06").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 400
 .top = 355
 .width=100
 .height=150
 end with 
 
 ActiveDocument.GetSheetObject("TX09").CopyBitmapToClipboard
 with objPresentation.Slides(1).Shapes.Paste
 .Left = 408
 .top = 510
 .width=80
 .height=25
 end with 
 
 Set PPSlide = Nothing
 Set PPPres = Nothing
 
 End sub 
if that helps you, let me know
Beck
You can use nPrinting Introducing QlikView NPrinting | Qlik
Hi,
Check now,
PFA,
Hirish
Hi Kiran, i understand your doubt, but i use These code in Access Point, and it does work. of cource in Internet Explorer plugin-Modus.
if you have any question, i can send my example.
Beck
Hi ,
Can you tell me have i missed anything.
-Hirish