Code stage : From VBA to Blue Prism
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-07-18 07:38 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-07-18 11:46 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-07-18 02:08 PM
Hi,
Thank you for your answer. I will keep working on it then !
