Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
SunilChauhan
Champion II
Champion II

Export to ppt and Customizing each shape left,top postions and also Width and height

sub ExportPDF

set SheetName=ActiveDocument.Variables("vSheetName")

set vLeft=ActiveDocument.Variables("vLeft")

set vTop=ActiveDocument.Variables("vTop")

set vWidth=ActiveDocument.Variables("vWidth")

set vHeight=ActiveDocument.Variables("vHeight")

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True ' Create a presentation

Set PPPres = PPApp.Presentations.Add

set s=ActiveDocument.Sheets("Main")'SheetName.GetContent.String

charts=s.GetGraphs

for i=lbound(charts) to ubound(charts)

Set PPSlide = PPPres.Slides.Add(1, 1)

PPSlide.Shapes(1).Delete ' removes the title

PPSlide.Shapes(1).Delete ' removes the text box

'ActiveDocument.GetSheetObject(charts(i).getobjectid).maximize

ActiveDocument.GetSheetObject(charts(i).getobjectid).CopyBitmapToClipboard

'ActiveDocument.GetSheetObject(charts(i).getobjectid).minimize

with PPSlide.Shapes.Paste

.Left = vLeft.GetContent.String

.Top = vTop.GetContent.String

.Width=vWidth.GetContent.String

PPSlide.Shapes.Paste

end with

next

PPPres.SaveAs "C:\Trend_Charts.ppt"

PPPres.Close

'PPApp.Quit

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

end sub

I am using abovemacro to export to ppt .macro working fine for me . but i am not able to customize the below values for each shape.

and i want to provide different value for each shape in PPT

with PPSlide.Shapes.Paste

.Left = vLeft.GetContent.String--------------- want different left value for each chart But not working

.Top = vTop.GetContent.String---------------Want  different Top value for each chart But not working

.Width=vWidth.GetContent.String--------------> Want  different widthvalue for each chart. But not working

expression for variables (it might be wrong)

=If(Shape=0,0,

If(Shape=1,400,

If(Shape=2,0,

If(Shape=3,400,

If(Shape=4,0,

If(Shape=5,400))))))

Please help . Please provide your idea its urgent.

Regards

Sunil


Sunil Chauhan
1 Reply
SunilChauhan
Champion II
Champion II
Author

Any one its urgent please.

Sunil Chauhan