Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
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
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
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
It is not working in webview mode.