<?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 Trying to read excel from OLEDB in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96491#M44736</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;First of all, I never used OLEDB before.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm trying to read a excel file into a db and then read it as collection.&lt;BR /&gt;&lt;BR /&gt;My connection string looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&amp;amp;[Excel-file path]&amp;amp;";Extended Properties=""Excel 12.0 Xml;HDR=YES;"""&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;And my SQL querry in "Get Collection" action:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;"SELECT * FROM [SHEET1$]"&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;is the syntax wrong or something else that could be it?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Error message:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;Internal : Could not execute code stage because exception thrown by code stage: Invalid argument.&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;Also saw this earlier but not anymore:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;ERROR: Internal : Could not execute code stage because exception thrown by code stage: Could not find installable ISAM.&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johan Sörman&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RPA Developer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Telia Company&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sweden&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------&lt;/SPAN&gt;</description>
    <pubDate>Wed, 23 Feb 2022 11:12:32 GMT</pubDate>
    <dc:creator>JohanSörman</dc:creator>
    <dc:date>2022-02-23T11:12:32Z</dc:date>
    <item>
      <title>Trying to read excel from OLEDB</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96491#M44736</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;First of all, I never used OLEDB before.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm trying to read a excel file into a db and then read it as collection.&lt;BR /&gt;&lt;BR /&gt;My connection string looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="&amp;amp;[Excel-file path]&amp;amp;";Extended Properties=""Excel 12.0 Xml;HDR=YES;"""&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;And my SQL querry in "Get Collection" action:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;"SELECT * FROM [SHEET1$]"&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;is the syntax wrong or something else that could be it?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Error message:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;Internal : Could not execute code stage because exception thrown by code stage: Invalid argument.&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;Also saw this earlier but not anymore:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;ERROR: Internal : Could not execute code stage because exception thrown by code stage: Could not find installable ISAM.&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Johan Sörman&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RPA Developer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Telia Company&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sweden&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------&lt;/SPAN&gt;</description>
      <pubDate>Wed, 23 Feb 2022 11:12:32 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96491#M44736</guid>
      <dc:creator>JohanSörman</dc:creator>
      <dc:date>2022-02-23T11:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to read excel from OLEDB</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96492#M44737</link>
      <description>Hi Johan,&lt;BR /&gt;&lt;BR /&gt;Indeed can OLEDB be a dream to work with or a pain in the behind to get started with. Once you get it working, it is both fast and able to handle larger volumes of data. Well worth the effort!&lt;BR /&gt;&lt;BR /&gt;The order of all things OLEDB:&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;Connect to the XL with action 'Set connection' and your connection string. You can find all about this &lt;A href="https://www.connectionstrings.com/" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;BR /&gt;Mine usually look similar to this: &lt;BR /&gt;Replace("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=XYZ;Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;"";", "XYZ", [xl path])&lt;/LI&gt;
&lt;LI&gt;Wait a short while for things to fall into place. Usually 5 seconds does the trick for me&lt;/LI&gt;
&lt;LI&gt;Open OLEDB with action 'Open'&lt;/LI&gt;
&lt;LI&gt;Build your SQL statement, something like this: "select * from " &amp;amp; [xl sheet name] &amp;amp; " where " &amp;amp; [filter]&lt;BR /&gt;With:&lt;BR /&gt;'xl sheet name': "[" &amp;amp; [xl sheet name] &amp;amp; "$]"&lt;BR /&gt;'filter': "(YEAR = '2022' and ProductCode = '123')"&lt;/LI&gt;
&lt;LI&gt;Run your SQL statement with action 'Get Collection'&lt;/LI&gt;
&lt;LI&gt;Wait a short while for things to happen. Again, 5 seconds works for me&lt;/LI&gt;
&lt;LI&gt;Close the connection with action 'Close'&lt;/LI&gt;
&lt;/OL&gt;
&lt;SPAN style="color: #ff0000"&gt;'&lt;EM&gt;Known&lt;/EM&gt;' issues:&lt;/SPAN&gt;&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="color: #ff0000"&gt;Duplicate column names in your XL are not appreciated by OLEDB&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="color: #ff0000"&gt;OLEDB does not like illegal characters in XL column names (a dot in a column name is considered illegal, there are probably more)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
Try this and see if it helps. Otherwise, there's more &lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?GroupId=139&amp;amp;MessageKey=892d84a6-6cb0-4297-bb58-039b01d5f284&amp;amp;CommunityKey=ecea0082-1a23-4cd8-ab44-48e94657092e&amp;amp;tab=digestviewer" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;As always, happy coding!&lt;BR /&gt;---------------------------&lt;BR /&gt;Paul&lt;BR /&gt;Sweden</description>
      <pubDate>Wed, 23 Feb 2022 11:33:52 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96492#M44737</guid>
      <dc:creator>PvD_SE</dc:creator>
      <dc:date>2022-02-23T11:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to read excel from OLEDB</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96493#M44738</link>
      <description>In Connection String XML keyword should not be there .&lt;BR /&gt;&lt;BR /&gt;I am posting my code here which i am using every day.&lt;BR /&gt;&lt;BR /&gt;I written the Global Function code and i added 2 parameters to it, Full File Path and Sheet Name&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-vbnet"&gt;&lt;CODE&gt;Public Function ExcelSheetRead(ByVal filepath as String,sheetname as string) As DataTable
Dim dt As DataTable = New DataTable()
Dim Con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" &amp;amp; "Data Source=" &amp;amp; filepath &amp;amp; ";Extended Properties=Excel 12.0;")
Con.Open()

Try
                                                
	Dim oCon As OleDbCommand = New OleDbCommand("Select * from [" &amp;amp; sheetname &amp;amp; "$]",Con)
	Dim adp As OleDbDataAdapter = New OleDbDataAdapter(OCon)
	adp.Fill(dt)
                                                
Catch e_ As Exception

End Try

	Con.Close()
	Return dt
	
End Function
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35080.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/35146i95886BC7306A75D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="35080.png" alt="35080.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Feb 2022 17:31:41 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Trying-to-read-excel-from-OLEDB/m-p/96493#M44738</guid>
      <dc:creator>naveed_raza</dc:creator>
      <dc:date>2022-02-23T17:31:41Z</dc:date>
    </item>
  </channel>
</rss>

