By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,816 Members | 2,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,816 IT Pros & Developers. It's quick & easy.

Numeric column in Excel

P: n/a
KK
Hi,
Please check the code snippet below. I want the 4th column be numeric.
But, in the result it is always showing as text.
Any suggestions to show this column as numeric?
Thanks.
XLSConn = New ADODB.Connection
XLSConn.Open("Provider=Microso**ft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDestination & _
";Extended Properties=""Excel 8.0;HDR=NO;""")
Dim source As String
Dim arrData
Dim Counter As Integer
source = "Select * from [A6:G6" & "$" & strRecRange &
"]"
XLSrs.Open(source, XLSConn, 1, 3)
arrData = Split(strRec, Chr(9))
For Counter = LBound(arrData) To UBound(arrData) - 1
If Counter = 4 Then 'this column must be integer
XLSrs.Fields(Counter).Value =
Integer.Parse(arrData(Counter)*)
Else
XLSrs.Fields(Counter).Value = Left(arrData(Counter),
255)
End If
Next
XLSrs.Update()
XLSrs.Close()

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.