<?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: Microsoft 365 - Excel VBO Reading and Writing CSV in Digital Exchange</title>
    <link>https://community.blueprism.com/t5/Digital-Exchange/Microsoft-365-Excel-VBO-Reading-and-Writing-CSV/m-p/123721#M4570</link>
    <description>&lt;P&gt;&lt;STRONG&gt;for CSV to Collection&lt;/STRONG&gt; - you can use Utility - File Management object, which will have Get CSV Collection&lt;/P&gt;&lt;P&gt;for Collection to CSV - you can use this below code , create new object, add new action , add code stage with 2 input parameters (csv File Path, Collection to save as CSV) , create 2 output parameter (Success and Error Message)&lt;/P&gt;&lt;P&gt;this code will handle all double quotes , single quotes between names and comma between names&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim dt As DataTable = InCollection ' "collection" is your Blue Prism collection (DataTable)
Dim filePath As String = csvFilePath

Try
	Success = True
	ErrorMessage = ""

	Using sw As New StreamWriter(filePath, False, System.Text.Encoding.UTF8)
		
		'Write headers
		Dim columnNames As String = String.Join(",", dt.Columns.Cast(Of DataColumn)().Select(Function(column) """" &amp;amp; column.ColumnName.Replace("""", """""") &amp;amp; """"))
		sw.WriteLine(columnNames)
 
		'Write rows
		For Each row As DataRow In dt.Rows

			Dim fields As New List(Of String)()
			For Each column As DataColumn In dt.Columns
				Dim value As String = row(column).ToString()
				'Escape double-quotes in values, always use double quotes around value
				value = value.Replace("""", """""")
				fields.Add("""" &amp;amp; value &amp;amp; """")
			Next
			sw.WriteLine(String.Join(",", fields))
		Next
	End Using

Catch Ex as Exception
	Success = False
	ErrorMessage = Ex.ToString()

End Try&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2025 17:28:11 GMT</pubDate>
    <dc:creator>naveed_raza</dc:creator>
    <dc:date>2025-12-01T17:28:11Z</dc:date>
    <item>
      <title>Microsoft 365 - Excel VBO Reading and Writing CSV</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Microsoft-365-Excel-VBO-Reading-and-Writing-CSV/m-p/117268#M4053</link>
      <description>&lt;P&gt;I have two questions about handling CSV files with Microsoft 365 Excel VBO.&lt;BR /&gt;Firstly, I should be able to read a CSV and save it as a collection. In other words, I am looking for an action analogous to Get CSV Text as Collection.&lt;BR /&gt;On the other hand, I should be able to save an Excel file as a CSV file. Again, I did not find any action.&lt;BR /&gt;Can you help me with these two questions?&lt;BR /&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 13:23:02 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Microsoft-365-Excel-VBO-Reading-and-Writing-CSV/m-p/117268#M4053</guid>
      <dc:creator>EasyBluePrism</dc:creator>
      <dc:date>2024-12-02T13:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft 365 - Excel VBO Reading and Writing CSV</title>
      <link>https://community.blueprism.com/t5/Digital-Exchange/Microsoft-365-Excel-VBO-Reading-and-Writing-CSV/m-p/123721#M4570</link>
      <description>&lt;P&gt;&lt;STRONG&gt;for CSV to Collection&lt;/STRONG&gt; - you can use Utility - File Management object, which will have Get CSV Collection&lt;/P&gt;&lt;P&gt;for Collection to CSV - you can use this below code , create new object, add new action , add code stage with 2 input parameters (csv File Path, Collection to save as CSV) , create 2 output parameter (Success and Error Message)&lt;/P&gt;&lt;P&gt;this code will handle all double quotes , single quotes between names and comma between names&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim dt As DataTable = InCollection ' "collection" is your Blue Prism collection (DataTable)
Dim filePath As String = csvFilePath

Try
	Success = True
	ErrorMessage = ""

	Using sw As New StreamWriter(filePath, False, System.Text.Encoding.UTF8)
		
		'Write headers
		Dim columnNames As String = String.Join(",", dt.Columns.Cast(Of DataColumn)().Select(Function(column) """" &amp;amp; column.ColumnName.Replace("""", """""") &amp;amp; """"))
		sw.WriteLine(columnNames)
 
		'Write rows
		For Each row As DataRow In dt.Rows

			Dim fields As New List(Of String)()
			For Each column As DataColumn In dt.Columns
				Dim value As String = row(column).ToString()
				'Escape double-quotes in values, always use double quotes around value
				value = value.Replace("""", """""")
				fields.Add("""" &amp;amp; value &amp;amp; """")
			Next
			sw.WriteLine(String.Join(",", fields))
		Next
	End Using

Catch Ex as Exception
	Success = False
	ErrorMessage = Ex.ToString()

End Try&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 17:28:11 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Digital-Exchange/Microsoft-365-Excel-VBO-Reading-and-Writing-CSV/m-p/123721#M4570</guid>
      <dc:creator>naveed_raza</dc:creator>
      <dc:date>2025-12-01T17:28:11Z</dc:date>
    </item>
  </channel>
</rss>

