Dear all,
I'm already trying to automate some reporting by copying and pasting some graphs and pivot tables from an Excel to a Powerpoint.
I've done it first through VBA but I believe it would be a great use case to do it using RPA. I'm not a great coder so when I tried to copy-paste my code from VBA to a code stage in BP of course I had a lot of mistakes. Could you please support me in transforming this VBA code in a VB code that works?
Thank you very much.
Sub Copy()
Dim PPT As PowerPoint.Application
Dim PPTFile As PowerPoint.Presentation
Dim ActiveSlide As PowerPoint.Slide
Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
PPT.Presentations.Open Filename:="C:\Users\xxx\Documents\Reporting.PPTX"
Set PPTFile = PPT.ActivePresentation
PPT.ActiveWindow.ViewType = ppViewSlide
Workbooks("Reporting.xlsm").Activate
ActiveWorkbook.Sheets("Dashboard").ChartObjects("Chart_1).Copy
With PPTFile.Slides(5)
.Select
.Shapes.Paste
.Shapes("Chart_1").Select
.Application.ActiveWindow.Selection.ShapeRange.Left = 52.66575
.Application.ActiveWindow.Selection.ShapeRange.Top = 136.2691
.Application.ActiveWindow.Selection.ShapeRange.Height = 242.2116
.Application.ActiveWindow.Selection.ShapeRange.Width = 470.5457
End With