Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Export to PPT

Folks,

I´m using the macro below to export charts to PowerPoint, however I´m having issues with the parameters used for positioning.

Sub Export2PPT_IndividualCharts

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True ' Create a presentation

Set PPPres = PPApp.Presentations.Add

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

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

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

ActiveDocument.GetSheetObject("CH198").CopyBitmapToClipboard

ActiveDocument.GetApplication.WaitForIdle

  with PPSlide.Shapes.Paste

      .Left  = 150

      .Top  = 50

      .Width = 150

      .Height = 450

     end with

PPPres.SaveAs "C:\Individual.ppt" 'comment this if you dont want ppt to close automatically

PPPres.Close          'comment this if you dont want ppt to close automatically

PPApp.Quit      'comment this if you dont want ppt to close automatically

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub

I´m receiving expected object error message for

.Left  = 150

.Top  = 50

.Width = 150

.Height = 450


Any Ideas of what can be done to solve this problem ?

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Export to PPT

Hi,

could be that you have to add a with ?

with PPSlide.Shapes.Paste

  With .Shapes(.Shapes.Count)

    .Left = 50

    .Top = 100

    .Width = 600

    .Height = 400

  End With

End With

View solution in original post

3 Replies
Highlighted
Partner
Partner

Re: Export to PPT

Hi,

could be that you have to add a with ?

with PPSlide.Shapes.Paste

  With .Shapes(.Shapes.Count)

    .Left = 50

    .Top = 100

    .Width = 600

    .Height = 400

  End With

End With

View solution in original post

Highlighted
Partner
Partner

Re: Export to PPT

I also get success by using :

with PPSlide.Shapes.Paste
           PPSlide.Shapes(PPSlide.Shapes.Count).Left = 825
           PPSlide.Shapes(PPSlide.Shapes.Count).Top = 430
      end with

Highlighted
Specialist
Specialist

Re: Export to PPT

It is not working in webview mode.