<?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 xlCellTypeConstants is part… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82388#M33828</link>
    <description>xlCellTypeConstants is part of a VBA enumeration, and you'll be able to replace it with a 2. See&amp;nbsp;https://docs.microsoft.com/en-us/office/vba/api/excel.xlcelltype</description>
    <pubDate>Wed, 10 Apr 2019 13:29:00 GMT</pubDate>
    <dc:creator>John__Carter</dc:creator>
    <dc:date>2019-04-10T13:29:00Z</dc:date>
    <item>
      <title>Trim all Cells in Excel before importing to a collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82387#M33827</link>
      <description>Hello&amp;nbsp;

My issue is related to Excel and SAP reporting, I need to download a report from SAP and then extract that report and put it in a collection, however, I've noticed that when I download the report, it can sometimes have additional spaces in the header names, when this happens I cannot reference the collection because now it has a different header name, i.e. [SAP Report.Value] [SAP Report.&amp;nbsp; Value].

What I'm trying to do is to trim all cells in the excel file before adding its contents to a collection, to do this, I'm trying to use a code stage with the following VB&amp;nbsp;code:

Dim worksheet As Object
worksheet = GetWorkbook(handle,Nothing).ActiveSheet
Dim cell as Object = worksheet.Range

For Each cell In worksheet.UsedRange.SpecialCells(xlCellTypeConstants)
cell = WorksheetFunction.Trim(cell)
Next cell

however I'm getting the following error

xlCellTypeConstants is not declared, It may be inaccessible due to its protection level.

this code works in excel but since I'm new to code stages in BP, any idea of why I'm getting this error or any suggestions to trim all content before importing to a colleciton?

thanks in advance

&amp;nbsp;</description>
      <pubDate>Tue, 09 Apr 2019 21:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82387#M33827</guid>
      <dc:creator>RicardoCabrera</dc:creator>
      <dc:date>2019-04-09T21:38:00Z</dc:date>
    </item>
    <item>
      <title>xlCellTypeConstants is part…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82388#M33828</link>
      <description>xlCellTypeConstants is part of a VBA enumeration, and you'll be able to replace it with a 2. See&amp;nbsp;https://docs.microsoft.com/en-us/office/vba/api/excel.xlcelltype</description>
      <pubDate>Wed, 10 Apr 2019 13:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82388#M33828</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2019-04-10T13:29:00Z</dc:date>
    </item>
    <item>
      <title>I simply modified Collection…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82389#M33829</link>
      <description>I simply modified Collection manipulation action like this:

For Each Column As DataColumn In Input_Collection.Columns
&amp;nbsp; &amp;nbsp;Column.ColumnName=Microsoft.Visualbasic.Replace(Column.ColumnName,""."","""").Trim()
Next
Output_Collection = Input_Collection</description>
      <pubDate>Thu, 11 Apr 2019 13:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82389#M33829</guid>
      <dc:creator>AndreyKudinov</dc:creator>
      <dc:date>2019-04-11T13:05:00Z</dc:date>
    </item>
    <item>
      <title>thanks, John didn't see your…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82390#M33830</link>
      <description>thanks, John didn't see your reply on time, I ended up doing something aikudino's suggestion although this only works for the headers it helped me to deploy a quick fix,
I'll test replacing&amp;nbsp;xlCellTypeConstants with a ""2"" and see if that solves the issue, that way I'll have two methods on how to trim cells from excel and within the BP collection
thank you&amp;nbsp;for helping me
BR</description>
      <pubDate>Mon, 15 Apr 2019 22:40:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trim-all-Cells-in-Excel-before-importing-to-a-collection/m-p/82390#M33830</guid>
      <dc:creator>RicardoCabrera</dc:creator>
      <dc:date>2019-04-15T22:40:00Z</dc:date>
    </item>
  </channel>
</rss>

