<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Converting  VBA macro to Blue Prism Code Stage in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Converting-VBA-macro-to-Blue-Prism-Code-Stage/m-p/86365#M37228</link>
    <description>Good day team.&lt;BR /&gt;I'm wondering if it is possible to take code from an Excel macro and convert it within a code stage within Blue Prism. If possible, I would like to learn how to go about this.&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;Gavin&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Tue, 28 Sep 2021 06:45:00 GMT</pubDate>
    <dc:creator>GAVIN.RUDLING</dc:creator>
    <dc:date>2021-09-28T06:45:00Z</dc:date>
    <item>
      <title>Converting  VBA macro to Blue Prism Code Stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Converting-VBA-macro-to-Blue-Prism-Code-Stage/m-p/86365#M37228</link>
      <description>Good day team.&lt;BR /&gt;I'm wondering if it is possible to take code from an Excel macro and convert it within a code stage within Blue Prism. If possible, I would like to learn how to go about this.&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;Gavin&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Sep 2021 06:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Converting-VBA-macro-to-Blue-Prism-Code-Stage/m-p/86365#M37228</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2021-09-28T06:45:00Z</dc:date>
    </item>
    <item>
      <title>RE: Converting  VBA macro to Blue Prism Code Stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Converting-VBA-macro-to-Blue-Prism-Code-Stage/m-p/86366#M37229</link>
      <description>Hi Gavin&lt;BR /&gt;&lt;BR /&gt;You can in a sense convert it to blueprism but it would require some editing on your part. The vba for macros and .net are a bit different but I often perform an action in excel and record it as a macro to help me speed up the development of the action in blueprism. Below is an example of an action recorded in excel and how that action is written in blueprism. There's a bit more work to get it in blueprism and you need to have your variables set etc, the action in my example simply selects a range of cells and drags the values to a specified range.&lt;BR /&gt;&lt;BR /&gt;Macro recorded in excel&lt;BR /&gt;--------------------------------&lt;BR /&gt;Sub Macro1()&lt;BR /&gt;'&lt;BR /&gt;' Macro1 Macro&lt;BR /&gt;'&lt;BR /&gt;Range("A1:A3").Select&lt;BR /&gt;Selection.AutoFill Destination:=Range("A1:A20"), Type:=xlFillDefault&lt;BR /&gt;Range("A1:A20").Select&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Action as it looks in blueprism&lt;BR /&gt;----------------------------------&lt;BR /&gt;Dim wb, ws, source_range, fill_range As Object &lt;BR /&gt;Dim excel, sheet, range As Object &lt;BR /&gt;&lt;BR /&gt;wb = GetWorkbook(Handle, Workbook) &lt;BR /&gt;ws = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;&lt;BR /&gt;wb.Activate() &lt;BR /&gt;ws.Activate() &lt;BR /&gt;&lt;BR /&gt;excel = ws.Application &lt;BR /&gt;sheet = excel.ActiveSheet &lt;BR /&gt;source_range = sheet.Range(SourceRange) &lt;BR /&gt;source_range.Select()&lt;BR /&gt;fill_range = sheet.Range(FillRange) &lt;BR /&gt;source_range.AutoFill(Destination:=fill_range) &lt;BR /&gt;&lt;BR /&gt;Your source range is the cells selected and fill range is the range you want to drag the cells to. Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michael ONeil&lt;BR /&gt;Technical Lead developer&lt;BR /&gt;Everis Consultancy&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Sep 2021 08:33:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Converting-VBA-macro-to-Blue-Prism-Code-Stage/m-p/86366#M37229</guid>
      <dc:creator>michaeloneil</dc:creator>
      <dc:date>2021-09-28T08:33:00Z</dc:date>
    </item>
  </channel>
</rss>

