How to Read Excel File AT VB.NEThttp://forums.asp.net/t/1301233.aspx/1?How+to+Read+Excel+File+AT+VB+NETFri, 25 Sep 2009 03:42:47 -040013012332539073http://forums.asp.net/p/1301233/2539073.aspx/1?How+to+Read+Excel+File+AT+VB+NETHow to Read Excel File AT VB.NET <p>Hi anyone know how do i read excel file at VB.net &amp; display the result in a label or something..</p> <p>&nbsp;</p> <p>e.g i know cell A2 is a string of text - e.g Hello this is the P/L for the month&nbsp;</p> <p>&nbsp;</p> <p>i want grab that and put in a label etc.</p> <p><br> Thanks , it would be good if can refer me to url on using Microsoft Excel Library Object &amp; its coding to connect, close connection , grab data from cell and input back the data.</p> <p>&nbsp;</p> <p><b>Regards,<br> Bao</b><br> <br> <br> &nbsp;</p> 2008-08-06T03:23:58-04:002539121http://forums.asp.net/p/1301233/2539121.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>With the proper connection string (<a href="http://www.connectionstrings.com/?carrier=excel">http://www.connectionstrings.com/?carrier=excel</a>)&nbsp;you can query it like any datasource.&nbsp; Using the Excel Interop is, frankly, sometimes a pain.</p> 2008-08-06T03:57:26-04:002539608http://forums.asp.net/p/1301233/2539608.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>if by setting a connection string to excel.</p> <p>&nbsp;</p> <p>how do i query it like any data source?&nbsp; i never try before querying excel, is there any tutorial or sample </p> <p>&nbsp;</p> <p>Thanks,</p> <p>Baoky&nbsp;</p> 2008-08-06T08:29:13-04:002539677http://forums.asp.net/p/1301233/2539677.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>Heres some code I use to connect to an excel data range&nbsp; :-<pre class="prettyprint">Using m_connexcel As OleDbConnection = New OleDbConnection(String.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; &amp; _ &quot;Data Source={0};&quot; &amp; _ &quot;Extended Properties=&quot;&quot;Excel 8.0;HDR=NO&quot;&quot;&quot;, SPREADSHEET_NAME)) m_connexcel.Open() Using cmd As OleDbCommand = New OleDbCommand(String.Format(&quot;SELECT * FROM [{0}]&quot;, DATARANGE), m_connexcel) Using oRDR As OleDbDataReader = cmd.ExecuteReader While (oRDR.Read) If Not oRDR.IsDBNull(oRDR.GetOrdinal(&quot;F1&quot;)) Then MsgBox(oRDR.GetString(oRDR.GetOrdinal(&quot;F1&quot;))) End If End While End Using End Using m_connexcel.Close() End Using</pre><pre class="prettyprint">Set 'HDR' in the connection string to 'YES' if you want to use the first row as the field names, otherwise the fields will be called<BR>F1, F2, F3 etc...</pre><pre class="prettyprint">&nbsp;</pre>&nbsp;</p> 2008-08-06T09:00:11-04:002544657http://forums.asp.net/p/1301233/2544657.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>How do i query it after i connect to the excel file.</p> <p>&nbsp;</p> <p>e.g , i want query from A1 to A20 or A1 to A10&#43; B1 to B10</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>Thanks</p> <p>Rgds,</p> <p>Bao&nbsp;</p> 2008-08-08T02:53:34-04:002545296http://forums.asp.net/p/1301233/2545296.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET You basically wrap the data you want to query in a named data range (Insert Menu -&gt; Name -&gt; Define) and then you can select the info using a&nbsp; SQL style select statement as above. 2008-08-08T09:36:02-04:002917590http://forums.asp.net/p/1301233/2917590.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>i used the codes in this <a href="http://vb.net-informations.com/excel-2007/vb.net_excel_oledb.htm"> http://vb.net-informations.com/excel-2007/vb.net_excel_oledb.htm</a>&nbsp;a message box appears that says system.data.oledb.oledbexception: cannot update. database or object is read-only. what seems to be the problem? </p> 2009-02-05T05:42:29-05:002927860http://forums.asp.net/p/1301233/2927860.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>Did you have the excel file open when your program was running?</p> 2009-02-09T15:12:15-05:003319048http://forums.asp.net/p/1301233/3319048.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>Hi,<br> <br> Best way to deal with Excel in VB is by using 3rd party component. It's much faster and easier way then Excel Automation. Try using GemBox <a target="_self" title="spreadsheet component" href="http://www.gemboxsoftware.com/GBSpreadsheet.htm"> spreadsheet component</a> for exporting Excel. Component is free for commercial use but with limit of 150 rows.<br> <br> Here you can see a list of reason why GemBox.Spreadsheet is much better tool to work with Excel then <a target="_self" title="excel automation excel interop" href="http://www.gemboxsoftware.com/Excel-Automation.htm"> Excel Automation</a>.<br> <br> Filip<br> GemBox.Spreadsheet - <a target="_self" title="easy create read write excel files .net" href="http://www.gemboxsoftware.com/"> easiest way to create, read and write Excel files in .NET</a><br> </p> 2009-07-29T13:34:42-04:003330388http://forums.asp.net/p/1301233/3330388.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>Hi, How do I read an Excel file that is located in a client PC?</p> <p><br> </p> <p>Thanks<br> </p> 2009-08-05T06:56:44-04:003330460http://forums.asp.net/p/1301233/3330460.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>&nbsp;You'd have to&nbsp;get them to upload the file to the server before hand, and then read the Excel file on the server.</p> 2009-08-05T07:34:25-04:003424438http://forums.asp.net/p/1301233/3424438.aspx/1?Re+How+to+Read+Excel+File+AT+VB+NETRe: How to Read Excel File AT VB.NET <p>You can try <a title="SmartXLS for .net" href="http://www.smartxls.com">SmartXLS</a>,it is a third party spreadsheet component which <font size="2" color="#336699" face="Verdana, Arial, Helvetica, sans-serif"><font size="2" color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><span id="KonaBody">can write, read, calculate Excel compatible files without the need for Microsoft Excel.</span></font><font size="1" color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><br> </font></font></p> 2009-09-25T03:42:47-04:00