<?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: i was lucky to get the code in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81965#M33461</link>
    <description>&lt;P&gt;Hi Ravi,&lt;BR /&gt;&lt;BR /&gt;For your desired use case please follow the below steps to create a new action for performing the required operation.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: You should ideally create a duplicate business object for the same and do the required modifications so that the original business object is not affected and you can use it for reference.&lt;/STRONG&gt; &lt;BR /&gt;&lt;BR /&gt;Create a new action called '&lt;STRONG&gt;Freeze Panes&lt;/STRONG&gt;' within the '&lt;STRONG&gt;MS Excel&lt;/STRONG&gt;' VBO object which consists of other actions. Add the following input parameters to this action:&lt;BR /&gt;&lt;BR /&gt;- Handle (Number) : The instance of the excel sessions held in the dictionary to establish the current excel connection.&lt;BR /&gt;&lt;BR /&gt;- Workbook (Text) : The workbook name returned while using either 'Open Workbook' or 'Create Workbook' actions.&lt;BR /&gt;&lt;BR /&gt;- Worksheet (Text) : The worksheet name where the operation needs to be performed.&lt;BR /&gt;&lt;BR /&gt;- Cell Reference : The cell address from where the freeze pane action needs to be performed.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Solution Workflow:&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18880.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19031iE2374662A517F8D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="18880.png" alt="18880.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;Add the code stage named &lt;STRONG&gt;'Freeze Pane'&lt;/STRONG&gt; with the following parameters and code:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18881.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19032i7AF56BE578881CDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="18881.png" alt="18881.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Code:&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18882.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19034i6816E4497A4B9E0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="18882.png" alt="18882.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;Dim wb, ws 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;range = sheet.Range(Reference)&lt;BR /&gt;&lt;BR /&gt;range.Rows(1).Select()&lt;BR /&gt;excel.ActiveWindow.FreezePanes = True&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;Test Scenario:&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;I have created a workflow and provide the parameters for 'Freeze Pane' action as follows in the process studio:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18883.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19035i5739600BD19B8CB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="18883.png" alt="18883.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18884.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19036iA9E936AB97BCCEC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="18884.png" alt="18884.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: Ensure that all the actions are used from the same VBO where Freeze Pane action has been created in order to avoid unexpected errors.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The input file before execution looks like below:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18885.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19033i7F59557DE3858918/image-size/large?v=v2&amp;amp;px=999" role="button" title="18885.png" alt="18885.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Upon executing the workflow, the results are as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18886.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19038i0C23171EB1FBD46B/image-size/large?v=v2&amp;amp;px=999" role="button" title="18886.png" alt="18886.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Here, the freeze pane has been added at the given cell reference. Also, please find the attached sample business object for your reference.&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;Wonderbotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Sun, 08 May 2022 09:56:00 GMT</pubDate>
    <dc:creator>devneetmohanty07</dc:creator>
    <dc:date>2022-05-08T09:56:00Z</dc:date>
    <item>
      <title>Turn on  AutoFilter  and Freeze Panes with Visual Basic</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81962#M33458</link>
      <description>Would anyone have the correct code to turn on AutoFilter or Freeze Panes with VB using Microsoft.Office.Interop.Excel. below is a sample ,but,  some of the lines are incorrect.

Dim excelApplication As  New Application 
Dim excelWrkBook As  Workbook 
Dim excelWrkSheet as Worksheet
Dim excelRange as Range



Try
excelApplication.DisplayAlerts = False
excelWrkBook = excelApplication.Workbooks.Open("C:\TestFolder\TestFile.xlsx")
excelRange = excelWrksheet.Range("TestFile")

excelRange.AutoFilter()
excelWrkBook.Save
excelWrkBook.Close()
excelApplication.Quit()

thank you</description>
      <pubDate>Tue, 29 Nov 2016 19:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81962#M33458</guid>
      <dc:creator>RickMartin</dc:creator>
      <dc:date>2016-11-29T19:43:00Z</dc:date>
    </item>
    <item>
      <title>i was lucky to get the code</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81963#M33459</link>
      <description>i was lucky to get the code from a developer, here is the code that works.
Dim wexcel As New Application
Dim wBook As Workbook
Dim wSheet As Worksheet
' Dim excelRange As Range
Dim excelApplication As New Application
' Dim excelWrkBook As Workbook
       wexcel.Visible = True
        'open your file
        wexcel.Workbooks.Open(""C:\TestFolder\TLBUpdatedSpreadsheet.xlsx"")
        'select the first workbook into your global variable
        wBook = wexcel.Workbooks(1)
        'select the first sheet into your global variable
        wSheet = wBook.Sheets(1)
        wSheet.Activate()
        'select your column
        wSheet.Columns(""D"").Select()
        'freeze your selection
        wSheet.Application.ActiveWindow.FreezePanes = True
        'choose the range of columns you want to autofilter
        wSheet.Range(""A:AZ"").AutoFilter(Field:=1, Operator:=XlAutoFilterOperator.xlFilterValues)
        'save your work as a new file
        wBook.SaveAs(""C:\TestFolder\New_TLBUpdatedSpreadsheet.xlsx"")
        wBook.Close()
        wexcel.Application.Quit()</description>
      <pubDate>Fri, 09 Dec 2016 16:54:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81963#M33459</guid>
      <dc:creator>RickMartin</dc:creator>
      <dc:date>2016-12-09T16:54:00Z</dc:date>
    </item>
    <item>
      <title>RE: i was lucky to get the code</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81964#M33460</link>
      <description>Hi Rick,&lt;BR /&gt;&lt;BR /&gt;Could you please provide me the code to freeze a particular row in excel using code stage.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ravi kiran P&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2022 13:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81964#M33460</guid>
      <dc:creator>Ravikiran44</dc:creator>
      <dc:date>2022-05-06T13:06:00Z</dc:date>
    </item>
    <item>
      <title>RE: i was lucky to get the code</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81965#M33461</link>
      <description>&lt;P&gt;Hi Ravi,&lt;BR /&gt;&lt;BR /&gt;For your desired use case please follow the below steps to create a new action for performing the required operation.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: You should ideally create a duplicate business object for the same and do the required modifications so that the original business object is not affected and you can use it for reference.&lt;/STRONG&gt; &lt;BR /&gt;&lt;BR /&gt;Create a new action called '&lt;STRONG&gt;Freeze Panes&lt;/STRONG&gt;' within the '&lt;STRONG&gt;MS Excel&lt;/STRONG&gt;' VBO object which consists of other actions. Add the following input parameters to this action:&lt;BR /&gt;&lt;BR /&gt;- Handle (Number) : The instance of the excel sessions held in the dictionary to establish the current excel connection.&lt;BR /&gt;&lt;BR /&gt;- Workbook (Text) : The workbook name returned while using either 'Open Workbook' or 'Create Workbook' actions.&lt;BR /&gt;&lt;BR /&gt;- Worksheet (Text) : The worksheet name where the operation needs to be performed.&lt;BR /&gt;&lt;BR /&gt;- Cell Reference : The cell address from where the freeze pane action needs to be performed.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Solution Workflow:&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18880.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19031iE2374662A517F8D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="18880.png" alt="18880.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;Add the code stage named &lt;STRONG&gt;'Freeze Pane'&lt;/STRONG&gt; with the following parameters and code:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18881.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19032i7AF56BE578881CDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="18881.png" alt="18881.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Code:&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18882.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19034i6816E4497A4B9E0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="18882.png" alt="18882.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;Dim wb, ws 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;range = sheet.Range(Reference)&lt;BR /&gt;&lt;BR /&gt;range.Rows(1).Select()&lt;BR /&gt;excel.ActiveWindow.FreezePanes = True&lt;STRONG&gt;&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;Test Scenario:&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;I have created a workflow and provide the parameters for 'Freeze Pane' action as follows in the process studio:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18883.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19035i5739600BD19B8CB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="18883.png" alt="18883.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18884.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19036iA9E936AB97BCCEC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="18884.png" alt="18884.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: Ensure that all the actions are used from the same VBO where Freeze Pane action has been created in order to avoid unexpected errors.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The input file before execution looks like below:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18885.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19033i7F59557DE3858918/image-size/large?v=v2&amp;amp;px=999" role="button" title="18885.png" alt="18885.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Upon executing the workflow, the results are as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18886.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/19038i0C23171EB1FBD46B/image-size/large?v=v2&amp;amp;px=999" role="button" title="18886.png" alt="18886.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Here, the freeze pane has been added at the given cell reference. Also, please find the attached sample business object for your reference.&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;----------------------------------&lt;BR /&gt;Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Devneet Mohanty&lt;BR /&gt;Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,&lt;BR /&gt;Wonderbotz India Pvt. Ltd.&lt;BR /&gt;Blue Prism Community MVP | Blue Prism 7x Certified Professional&lt;BR /&gt;Website: &lt;A href="https://devneet.github.io/" target="test_blank"&gt;https://devneet.github.io/&lt;/A&gt;&lt;BR /&gt;Email: devneetmohanty07@gmail.com&lt;BR /&gt;&lt;BR /&gt;----------------------------------&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sun, 08 May 2022 09:56:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Turn-on-AutoFilter-and-Freeze-Panes-with-Visual-Basic/m-p/81965#M33461</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-05-08T09:56:00Z</dc:date>
    </item>
  </channel>
</rss>

