<?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: VBA to .NET ? in University Forum</title>
    <link>https://community.blueprism.com/t5/University-Forum/VBA-to-NET/m-p/87026#M1789</link>
    <description>I'm kind of getting there by modifying the code Stage of Import CSV , it does the job for the numbers, but still not what i need&lt;BR /&gt;I'm trying to combine this code with the code above, but still getting errors bc i suck at vb.net&lt;BR /&gt;Is there a way to get the type of&amp;nbsp; cell just before the import?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dim dw, ds, dr, qt As Object&lt;BR /&gt;Dim formats() As Long, i As Long&lt;BR /&gt;&lt;BR /&gt;ReDim formats(0 To 100)&lt;BR /&gt;For i = 0 To 100&lt;BR /&gt;formats(i) = 2&lt;BR /&gt;Next i&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;dw = GetWorkbook(Handle, Workbook)&lt;BR /&gt;ds = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;dr = ds.Range(Range)&lt;BR /&gt;qt = ds.QueryTables.Add(Connection:="TEXT;" &amp;amp; Path, Destination:=dr)&lt;BR /&gt;&lt;BR /&gt;With qt&lt;BR /&gt;.FieldNames = True&lt;BR /&gt;.RowNumbers = False&lt;BR /&gt;.FillAdjacentFormulas = False&lt;BR /&gt;.PreserveFormatting = True&lt;BR /&gt;.RefreshOnFileOpen = False&lt;BR /&gt;.RefreshStyle = 1 'xlInsertDeleteCells&lt;BR /&gt;.SavePassword = False&lt;BR /&gt;.SaveData = True&lt;BR /&gt;.AdjustColumnWidth = True&lt;BR /&gt;.RefreshPeriod = 0&lt;BR /&gt;.TextFilePromptOnRefresh = False&lt;BR /&gt;.TextFilePlatform = 437&lt;BR /&gt;.TextFileStartRow = 1&lt;BR /&gt;.TextFileParseType = 1 'xlDelimited&lt;BR /&gt;.TextFileTextQualifier = Qualifier&lt;BR /&gt;.TextFileConsecutiveDelimiter = False&lt;BR /&gt;.TextFileTabDelimiter = False&lt;BR /&gt;.TextFileSemicolonDelimiter = False&lt;BR /&gt;.TextFileCommaDelimiter = True&lt;BR /&gt;.TextFileSpaceDelimiter = False&lt;BR /&gt;.TextFileColumnDataTypes = formats&lt;BR /&gt;.TextFileTrailingMinusNumbers = True&lt;BR /&gt;&lt;BR /&gt;End With&lt;BR /&gt;qt.Refresh(False)&lt;BR /&gt;&lt;BR /&gt;Success = True&lt;BR /&gt;&lt;BR /&gt;Catch e As Exception&lt;BR /&gt;Success = False&lt;BR /&gt;Message = e.Message&lt;BR /&gt;Finally&lt;BR /&gt;dw = Nothing&lt;BR /&gt;ds = Nothing&lt;BR /&gt;dr = Nothing&lt;BR /&gt;qt = Nothing&lt;BR /&gt;End Try&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Luz Benitez&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Fri, 09 Oct 2020 02:40:00 GMT</pubDate>
    <dc:creator>LuzBenitez</dc:creator>
    <dc:date>2020-10-09T02:40:00Z</dc:date>
    <item>
      <title>VBA to .NET ?</title>
      <link>https://community.blueprism.com/t5/University-Forum/VBA-to-NET/m-p/87025#M1788</link>
      <description>so Im working in a CSV File that have some columns with more than 15 number characters, and dates, and Strings&lt;BR /&gt;I use the import CSV action and then I want To format the current sheet, so I Try to make a code Stage&amp;nbsp; to "Format" Those columns, I have wrote the code on VBA it works with a macro, but I dont wan to to use macro along with blue prism&lt;BR /&gt;theres my code&amp;nbsp;&lt;BR /&gt;
&lt;DIV&gt;Sub Macro1()&lt;BR /&gt;Dim C As Integer&lt;BR /&gt;For i = 1 To ActiveSheet.UsedRange.Columns.Count&lt;BR /&gt;ActiveSheet.Cells(3, i).Select&lt;BR /&gt;If IsNumeric(Selection) Then&lt;BR /&gt;Columns(i).NumberFormat = "###,###,###,###.###,##0.00"&lt;BR /&gt;ElseIf WorksheetFunction.IsText(Selection) Then&lt;BR /&gt;Columns(i).NumberFormat = "@"&lt;BR /&gt;ElseIf IsDate(Selection) Then&lt;BR /&gt;Columns(i).NumberFormat = "yyyy-MM-dd hh:mm:ss.0"&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;How can I properly "translate" that code into blue prism?&lt;BR /&gt;I keep getting erros like Columns needs to be declared, etc&lt;BR /&gt;I'll appreciate some tips or help&amp;nbsp;&lt;BR /&gt;Thanks!!!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Luz Benitez&lt;BR /&gt;------------------------------</description>
      <pubDate>Thu, 08 Oct 2020 23:42:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/VBA-to-NET/m-p/87025#M1788</guid>
      <dc:creator>LuzBenitez</dc:creator>
      <dc:date>2020-10-08T23:42:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBA to .NET ?</title>
      <link>https://community.blueprism.com/t5/University-Forum/VBA-to-NET/m-p/87026#M1789</link>
      <description>I'm kind of getting there by modifying the code Stage of Import CSV , it does the job for the numbers, but still not what i need&lt;BR /&gt;I'm trying to combine this code with the code above, but still getting errors bc i suck at vb.net&lt;BR /&gt;Is there a way to get the type of&amp;nbsp; cell just before the import?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Dim dw, ds, dr, qt As Object&lt;BR /&gt;Dim formats() As Long, i As Long&lt;BR /&gt;&lt;BR /&gt;ReDim formats(0 To 100)&lt;BR /&gt;For i = 0 To 100&lt;BR /&gt;formats(i) = 2&lt;BR /&gt;Next i&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;dw = GetWorkbook(Handle, Workbook)&lt;BR /&gt;ds = GetWorksheet(Handle, Workbook, Worksheet)&lt;BR /&gt;dr = ds.Range(Range)&lt;BR /&gt;qt = ds.QueryTables.Add(Connection:="TEXT;" &amp;amp; Path, Destination:=dr)&lt;BR /&gt;&lt;BR /&gt;With qt&lt;BR /&gt;.FieldNames = True&lt;BR /&gt;.RowNumbers = False&lt;BR /&gt;.FillAdjacentFormulas = False&lt;BR /&gt;.PreserveFormatting = True&lt;BR /&gt;.RefreshOnFileOpen = False&lt;BR /&gt;.RefreshStyle = 1 'xlInsertDeleteCells&lt;BR /&gt;.SavePassword = False&lt;BR /&gt;.SaveData = True&lt;BR /&gt;.AdjustColumnWidth = True&lt;BR /&gt;.RefreshPeriod = 0&lt;BR /&gt;.TextFilePromptOnRefresh = False&lt;BR /&gt;.TextFilePlatform = 437&lt;BR /&gt;.TextFileStartRow = 1&lt;BR /&gt;.TextFileParseType = 1 'xlDelimited&lt;BR /&gt;.TextFileTextQualifier = Qualifier&lt;BR /&gt;.TextFileConsecutiveDelimiter = False&lt;BR /&gt;.TextFileTabDelimiter = False&lt;BR /&gt;.TextFileSemicolonDelimiter = False&lt;BR /&gt;.TextFileCommaDelimiter = True&lt;BR /&gt;.TextFileSpaceDelimiter = False&lt;BR /&gt;.TextFileColumnDataTypes = formats&lt;BR /&gt;.TextFileTrailingMinusNumbers = True&lt;BR /&gt;&lt;BR /&gt;End With&lt;BR /&gt;qt.Refresh(False)&lt;BR /&gt;&lt;BR /&gt;Success = True&lt;BR /&gt;&lt;BR /&gt;Catch e As Exception&lt;BR /&gt;Success = False&lt;BR /&gt;Message = e.Message&lt;BR /&gt;Finally&lt;BR /&gt;dw = Nothing&lt;BR /&gt;ds = Nothing&lt;BR /&gt;dr = Nothing&lt;BR /&gt;qt = Nothing&lt;BR /&gt;End Try&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Luz Benitez&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Oct 2020 02:40:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/VBA-to-NET/m-p/87026#M1789</guid>
      <dc:creator>LuzBenitez</dc:creator>
      <dc:date>2020-10-09T02:40:00Z</dc:date>
    </item>
  </channel>
</rss>

