Qlik Community

QlikView Documents

Documents for QlikView related information.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today

Prepare PPT from different QVW objects with Macro

Contributor III
Contributor III

Prepare PPT from different QVW objects with Macro

CTRL+M activate macro screen then write below code (Export_All_Chart_Images) in macro screen.

Scripting Engine = VBScript selected.

Requested Module Security = System Access

Current Local Security = Allow System Access

press OK


On Sheet,
New sheet objects> Add button>properties>actions>Add>External>Action=Run Macro>MacroName=Export_All_Chart_Images>Press OK


...MACRO SCRİPT...

sub Export_All_Chart_Images()
filePath = "C:\Users\imren.cimen\Desktop\RAPORLARQW\Test.ppt"  'where u want to save your ppt file.
set objPPT = createobject("PowerPoint.Application")
objPPT.Visible = True
set objPresentation = objPPT.Presentations.Add


'First Page
Set PPSlide = objPresentation.Slides.Add(1,12)
ActiveDocument.GetSheetObject("TX06").CopyBitmapToClipboard
objPPT.Visible = True 
PPSlide.Shapes.Paste()
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 30 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 65 'This sets the left location 
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 400 
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 100 

'second Page objPresentation.Slides.Add(2,12)
Set PPSlide = objPresentation.Slides.Add(2,12)
ActiveDocument.GetSheetObject("TX08").CopyBitmapToClipboard
objPPT.Visible = True 
PPSlide.Shapes.Paste()
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 30 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 65 'This sets the left location 
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 400 
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 100 

ActiveDocument.GetSheetObject("CH04").CopyBitmapToClipboard
objPPT.Visible = True 
PPSlide.Shapes.Paste()
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 150 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 60 'This sets the left location 
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 240 
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 250 
 
ActiveDocument.GetSheetObject("CH03").CopyBitmapToClipboard
objPPT.Visible = True 

PPSlide.Shapes.Paste() 
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 150 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 480 'This sets the left location 
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 240 
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 250

'Third Page from different qvw
Set PPSlide = objPresentation.Slides.Add(3,12)
set app=activedocument.getapplication  'Open other Qvw file
set newdoc=app.opendoc("C:\Users\imren.cimen\Desktop\RAPORLARQW\OEEas.qvw","","") 'Qvw files path.
newdoc.activatesheetbyid"SH01"
newdoc.GetSheetObject("CH01").CopyBitmapToClipboard
objPPT.Visible = True 
PPSlide.Shapes.Paste()
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 30 'This sets the top location of the image
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 65 'This sets the left location 
PPSlide.Shapes(PPSlide.Shapes.Count).Width = 500 
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 300 
objPresentation.SaveAs filePath  'save ppt

  Set PPSlide = nothing
Set PPPres = nothing

End Sub 

Attachments
Comments
Not applicable

‌good work!

Contributor III
Contributor III

thanks

Specialist
Specialist

good work. A guy from VBA like me feel better in QV now....

0 Likes
Partner
Partner

Really nicely done - clean & easy to follow - many thanks!

0 Likes
Creator
Creator

Very good! Thank you so much.

0 Likes
Creator
Creator

How to change to paste as bitmap? because the image is obfuscated.

tks.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2016-04-07 06:52 AM
Updated by: