cancel
Showing results for 
Search instead for 
Did you mean: 

Code stage : From VBA to Blue Prism

DavidAssouline
Level 4
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
2 REPLIES 2

Vijaya_KumarA
Level 3
Hi David,   Open the default excel VBO and add an page new page then insert code stage to use the code.   Normally when you add an code stage you need to add global functions to avoid this the global functions are already in the Excel vbo

DavidAssouline
Level 4
Hi, Thank you for your answer. I will keep working on it then !