<?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 All, in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Work-with-Excel/m-p/62495#M15594</link>
    <description>All,
I'm no expert at VB, but the below should work. For the border actions, you could of course pass in a input for line style and weight and make the decision as to what to apply. But the below just uses a static value.
=================
COLORS
=================
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
ws.Range(myrange).Interior.Color = RGB(r,g,b)
===========
BORDERS - Around a range (excluding internal borders)
===========
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
Const xlContinuous = 1
Const xlThick = 4
Const xlSuperThin = 1
Const xlThin = 2
Const xlMedium = 3
ws.Range(myrange).BorderAround(LineStyle:=xlContinuous, Weight:=xlThin, color:=RGB(r,g,b))
===========
BORDERS - Around a range (including internal borders)
===========
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
Const xlContinuous = 1
Const xlThick = 4
Const xlSuperThin = 1
Const xlThin = 2
Const xlMedium = 3
   Dim rng =ws.Range(myrange)
    With rng.Borders
        .LineStyle = xlContinuous
        .Color = RGB(r,g,b)
        .Weight = xlThin
    End With</description>
    <pubDate>Thu, 21 Jul 2016 17:28:00 GMT</pubDate>
    <dc:creator>TomBlackburn1</dc:creator>
    <dc:date>2016-07-21T17:28:00Z</dc:date>
    <item>
      <title>Work with Excel</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Work-with-Excel/m-p/62494#M15593</link>
      <description>Hi,

How to work with Excel file? I mean modifying the file,such as adding borders, changing font etc. Are there particular VBOs used for it?

Thanks
P.K.</description>
      <pubDate>Mon, 11 Jul 2016 13:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Work-with-Excel/m-p/62494#M15593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-11T13:01:00Z</dc:date>
    </item>
    <item>
      <title>All,</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Work-with-Excel/m-p/62495#M15594</link>
      <description>All,
I'm no expert at VB, but the below should work. For the border actions, you could of course pass in a input for line style and weight and make the decision as to what to apply. But the below just uses a static value.
=================
COLORS
=================
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
ws.Range(myrange).Interior.Color = RGB(r,g,b)
===========
BORDERS - Around a range (excluding internal borders)
===========
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
Const xlContinuous = 1
Const xlThick = 4
Const xlSuperThin = 1
Const xlThin = 2
Const xlMedium = 3
ws.Range(myrange).BorderAround(LineStyle:=xlContinuous, Weight:=xlThin, color:=RGB(r,g,b))
===========
BORDERS - Around a range (including internal borders)
===========
INPUTS
=================
Handle [Number] (e.g. 1)
Workbook[Text] (e.g. ""myspreadsheet.xlsx"")
Worksheet [Text] (e.g. ""sheet1"")
myrange [Text] (e.g. ""A1:F8"")
r [Number] (e.g. 100)
g [Number] (e.g. 100)
b [Number] (e.g. 100)
================
CODE
================
Dim wb, ws As Object
Dim excel, sheet As Object
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
Const xlContinuous = 1
Const xlThick = 4
Const xlSuperThin = 1
Const xlThin = 2
Const xlMedium = 3
   Dim rng =ws.Range(myrange)
    With rng.Borders
        .LineStyle = xlContinuous
        .Color = RGB(r,g,b)
        .Weight = xlThin
    End With</description>
      <pubDate>Thu, 21 Jul 2016 17:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Work-with-Excel/m-p/62495#M15594</guid>
      <dc:creator>TomBlackburn1</dc:creator>
      <dc:date>2016-07-21T17:28:00Z</dc:date>
    </item>
  </channel>
</rss>

