Good Day.
I have a problem with writing values from excel spreadsheet to ado recordset.
The spreadsheet "prox" contains the column of values such as:
This column has text type.
I use following code:
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & wd & "\" & ThisWorkbook.Name & ";" & _
"Extended Properties=""Excel 8.0;HDR=No;"";"
objRecordset.Open "Select * FROM [prox$]", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
Then recordset contains
but numbers in text format are missed. On their places are empty spaces and
Debug.Print IsEmpty(objRecordset.Fields.Item(3).Value)
returns 'True' for them.
You might need to add the IMEX option
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & wd & "\" & ThisWorkbook.Name & ";" & _
"Extended Properties=""Excel 8.0;HDR=No;IMEX=1;"";"
For further details look at this SO's post