<?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 RE: Add columns to excel, Color Cell using Code in BP in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Add-columns-to-excel-Color-Cell-using-Code-in-BP/m-p/55966#M10228</link>
    <description>Hi Prateek,&lt;BR /&gt;&lt;BR /&gt;One of the many ways is you can check the value of the cell using&amp;nbsp; &lt;STRONG&gt;Go To Next Cell &lt;/STRONG&gt;from the &lt;STRONG&gt;MS Excel VBO&lt;/STRONG&gt; until you find the column with the header name you desire. Once you have identified the column, you can use the &lt;STRONG&gt;Insert Column(s)&lt;/STRONG&gt; action to insert the new column.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;In Joe Khor&lt;BR /&gt;Sr. Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 13 Aug 2020 22:21:00 GMT</pubDate>
    <dc:creator>InJoeKhor</dc:creator>
    <dc:date>2020-08-13T22:21:00Z</dc:date>
    <item>
      <title>Add columns to excel, Color Cell using Code in BP</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Add-columns-to-excel-Color-Cell-using-Code-in-BP/m-p/55965#M10227</link>
      <description>Hi Team,

&amp;nbsp;I am trying to perform the following actions in blueprism

&amp;nbsp;

Add columns to excel - used to add a new column at position D

Color Cell - used to change the background color of cell

&amp;nbsp;

I am adding them as a code stage in a new action in Excel VBO object. Please review the code and suggest on how to correct them, or what code should be used to perform the required functions.

&amp;nbsp;

&amp;nbsp;

Color Cell

&amp;nbsp;

Dim RR As Object
Dim excel As Object

Try
RR = GetWorksheet(Handle, WorkBookName, WorkSheetName)
RR.Activate()
excel = RR.Application &amp;nbsp;
RR.UsedRange.Select() &amp;nbsp;

RR.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
RR.Cells(1, 2) = "Red"

Success = True
Catch e As Exception
Success = False
Message = e.Message
End Try

&amp;nbsp;

Filter Cell

'Dim Selection as Range
'Dim excel As Object
Dim Columns as Object
Dim RR As Object

Try
RR = GetWorksheet(Handle, WorkBookName, WorkSheetName)
RR.Activate()
'excel = RR.Application &amp;nbsp;
RR.UsedRange.Select()&amp;nbsp;
Columns("D:D").Insert(Shift:=-4161, CopyOrigin:=0)
'Range("D1").Value = "Loc"

'Selection.Insert(Shift:=-4161, CopyOrigin:=0)
'Selection.Insert(Shift:=-4161, CopyOrigin:=0)
Success = True
Catch e As Exception
Success = False
Message = e.Message
End Try

&amp;nbsp;</description>
      <pubDate>Wed, 06 Jun 2018 17:08:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Add-columns-to-excel-Color-Cell-using-Code-in-BP/m-p/55965#M10227</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-06T17:08:00Z</dc:date>
    </item>
    <item>
      <title>RE: Add columns to excel, Color Cell using Code in BP</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Add-columns-to-excel-Color-Cell-using-Code-in-BP/m-p/55966#M10228</link>
      <description>Hi Prateek,&lt;BR /&gt;&lt;BR /&gt;One of the many ways is you can check the value of the cell using&amp;nbsp; &lt;STRONG&gt;Go To Next Cell &lt;/STRONG&gt;from the &lt;STRONG&gt;MS Excel VBO&lt;/STRONG&gt; until you find the column with the header name you desire. Once you have identified the column, you can use the &lt;STRONG&gt;Insert Column(s)&lt;/STRONG&gt; action to insert the new column.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;In Joe Khor&lt;BR /&gt;Sr. Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Aug 2020 22:21:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Add-columns-to-excel-Color-Cell-using-Code-in-BP/m-p/55966#M10228</guid>
      <dc:creator>InJoeKhor</dc:creator>
      <dc:date>2020-08-13T22:21:00Z</dc:date>
    </item>
  </channel>
</rss>

