<?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: Excel VBO once again - format numbers as text to real numbers in Deutschsprachige Community</title>
    <link>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44231#M119</link>
    <description>&lt;P&gt;Thank you John for your Hint.&lt;/P&gt;
&lt;P&gt;The Number format command did not work but I actually found something in Excel which seems promising.&lt;/P&gt;
&lt;P&gt;I tried to capture the command and syntax by recording a macro and get this:&lt;/P&gt;
&lt;PRE class="language-vb"&gt;&lt;CODE&gt;Columns("A:A").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(1, 1), TrailingMinusNumbers:=True&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With this I'm able to adjust the complete column at once. But I struggle with the syntax when I put it in a codestage.&lt;/P&gt;
&lt;P&gt;My codestage looks like this:&lt;/P&gt;
&lt;P&gt;(to begin with i duplicated the select codestage)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="language-vb"&gt;&lt;CODE&gt;Dim wb, ws As Object
Dim excel, sheet, range As Object

Try

wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)

wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
range = sheet.Range(Reference)
range.Select()

range.TextToColumns(DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True)


Success = True

Catch e As Exception
	Success = False
	Message = e.Message
Finally
	wb = Nothing
	ws = Nothing
	excel = Nothing
	sheet = Nothing
	range = Nothing
End Try&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I get several errors when I check the code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5110.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/5292i9DDF69BE7C31F058/image-size/large?v=v2&amp;amp;px=999" role="button" title="5110.png" alt="5110.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm not experienced at all with visual basic and vba for excel at all. So I just work with "trial and error" so far. in this case I don't even really know what xlDelimited and clDoubleQute really means ...&lt;/P&gt;
&lt;P&gt;
&lt;/P&gt;&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Marco Matuttis&lt;BR /&gt;Robot Process Automation Developer&lt;BR /&gt;INTER Krankenversicherung AG&lt;BR /&gt;Mannheim&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 10:21:00 GMT</pubDate>
    <dc:creator>MarcoMatuttis1</dc:creator>
    <dc:date>2022-04-12T10:21:00Z</dc:date>
    <item>
      <title>Excel VBO once again - format numbers as text to real numbers</title>
      <link>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44229#M117</link>
      <description>&lt;P&gt;I have a .xlsx file that I get from a SAP Export. When I open the file it shows the little autocorrect indicator in almost all the cells.&lt;/P&gt;
&lt;P&gt;see screenshot:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5131.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/5313iEAE9EE6B03A661F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="5131.png" alt="5131.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I hover the yellow exclamation mark indicator i get the following message:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5132.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/5314iF8ACE59D81E75AF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="5132.png" alt="5132.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;translation: The number in this cell is formated as text or an apostrophe is before that number.&lt;/P&gt;
&lt;P&gt;I can fix this error very fast when I do it manually. I click the exclamation mark and select convert the text to number and within seconds all the 25000+ cells are corrected. But I can't get blueprism to do the same.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5133.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/5319i081D4B7A37A43E58/image-size/large?v=v2&amp;amp;px=999" role="button" title="5133.png" alt="5133.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there any way I can do this with the whole worksheet with e.g. excel vbo ?&lt;/P&gt;
&lt;P&gt;For some reason I can not automate excel like I would automate other applications. I can't spy certain buttons and screen elements reliably.&lt;/P&gt;
&lt;P&gt;Unfortunately I also can not change the output of SAP to deliver myself a perfect formatted excel sheet to begin with. I must correct these cells containing number as string myself.&lt;/P&gt;
&lt;P&gt;Any advice, hint or solution ?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Marco Matuttis&lt;BR /&gt;Robot Process Automation Developer&lt;BR /&gt;INTER Krankenversicherung AG&lt;BR /&gt;Mannheim&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2022 07:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44229#M117</guid>
      <dc:creator>MarcoMatuttis1</dc:creator>
      <dc:date>2022-04-12T07:06:00Z</dc:date>
    </item>
    <item>
      <title>RE: Excel VBO once again - format numbers as text to real numbers</title>
      <link>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44230#M118</link>
      <description>Hi Marco&lt;BR /&gt;&lt;BR /&gt;One option would be to extend the Excel VBO with a new page that performs the formatting. For this I usually start by recording a macro so I can study the VBA. Then it's a case of replicating the functionality in a code stage using .Net. A quick Google suggest the code will be something like this&lt;BR /&gt;
&lt;DIV class="crayon-pre"&gt;
&lt;DIV class="crayon-line" id="crayon-62520bc41bfcf120112747-1"&gt;&lt;CODE&gt;&lt;SPAN class="crayon-e"&gt;Sheets&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-s"&gt;"Sheet1"&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-e"&gt;Cells&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-i"&gt;NumberFormat&lt;/SPAN&gt;&lt;SPAN class="crayon-h"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;=&lt;SPAN class="crayon-h"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN class="crayon-s"&gt;&lt;CODE&gt;"#,##0.00"&lt;/CODE&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;CODE&gt;&lt;SPAN class="crayon-e"&gt;Sheets&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;(&lt;/SPAN&gt;"Sheet1"&lt;SPAN class="crayon-sy"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-e"&gt;Range("G:K")&lt;/SPAN&gt;&lt;SPAN class="crayon-sy"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-i"&gt;NumberFormat&lt;/SPAN&gt;&lt;SPAN class="crayon-h"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;=&lt;SPAN class="crayon-h"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE&gt;"#,##0.00"&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;If you only need to read the file then maybe you could try using an OLEDB query instead of opening it in Excel.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;John Carter&lt;BR /&gt;Professional Services&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2022 08:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44230#M118</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2022-04-12T08:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: Excel VBO once again - format numbers as text to real numbers</title>
      <link>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44231#M119</link>
      <description>&lt;P&gt;Thank you John for your Hint.&lt;/P&gt;
&lt;P&gt;The Number format command did not work but I actually found something in Excel which seems promising.&lt;/P&gt;
&lt;P&gt;I tried to capture the command and syntax by recording a macro and get this:&lt;/P&gt;
&lt;PRE class="language-vb"&gt;&lt;CODE&gt;Columns("A:A").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(1, 1), TrailingMinusNumbers:=True&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With this I'm able to adjust the complete column at once. But I struggle with the syntax when I put it in a codestage.&lt;/P&gt;
&lt;P&gt;My codestage looks like this:&lt;/P&gt;
&lt;P&gt;(to begin with i duplicated the select codestage)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="language-vb"&gt;&lt;CODE&gt;Dim wb, ws As Object
Dim excel, sheet, range As Object

Try

wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)

wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
range = sheet.Range(Reference)
range.Select()

range.TextToColumns(DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True)


Success = True

Catch e As Exception
	Success = False
	Message = e.Message
Finally
	wb = Nothing
	ws = Nothing
	excel = Nothing
	sheet = Nothing
	range = Nothing
End Try&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I get several errors when I check the code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5110.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/5292i9DDF69BE7C31F058/image-size/large?v=v2&amp;amp;px=999" role="button" title="5110.png" alt="5110.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm not experienced at all with visual basic and vba for excel at all. So I just work with "trial and error" so far. in this case I don't even really know what xlDelimited and clDoubleQute really means ...&lt;/P&gt;
&lt;P&gt;
&lt;/P&gt;&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Marco Matuttis&lt;BR /&gt;Robot Process Automation Developer&lt;BR /&gt;INTER Krankenversicherung AG&lt;BR /&gt;Mannheim&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 10:21:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44231#M119</guid>
      <dc:creator>MarcoMatuttis1</dc:creator>
      <dc:date>2022-04-12T10:21:00Z</dc:date>
    </item>
    <item>
      <title>RE: Excel VBO once again - format numbers as text to real numbers</title>
      <link>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44232#M120</link>
      <description>&lt;P&gt;Ok it seems I found a solution that works.&lt;/P&gt;
&lt;PRE class="language-vb"&gt;&lt;CODE&gt;Dim wb, ws As Object
Dim excel, sheet, range As Object

Try

wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)

wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
range = sheet.Range(Reference)

range.TextToColumns(Destination:=range,ConsecutiveDelimiter:=False, DataType:="1", TextQualifier:="1", Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, TrailingMinusNumbers:=True)


Success = True

Catch e As Exception
	Success = False
	Message = e.Message
Finally
	wb = Nothing
	ws = Nothing
	excel = Nothing
	sheet = Nothing
	range = Nothing
End Try&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Marco Matuttis&lt;BR /&gt;Robot Process Automation Developer&lt;BR /&gt;INTER Krankenversicherung AG&lt;BR /&gt;Mannheim&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2022 12:52:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Deutschsprachige-Community/Excel-VBO-once-again-format-numbers-as-text-to-real-numbers/m-p/44232#M120</guid>
      <dc:creator>MarcoMatuttis1</dc:creator>
      <dc:date>2022-04-12T12:52:00Z</dc:date>
    </item>
  </channel>
</rss>

