Hi
Please check this code:
Hope this will help you.
Please check this code:
Code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source="EMP";Extended Properties=""Excel 8.0;HDR=Yes;"";"
strQuery = "Select * From Emp where EmpID IS NOT NULL"
objRecordSet.Open strQuery, objConnection, adOpenStatic, adLockOptimistic, adCmdText
intColCnt = objRecordSet.Fields.Count
Hope this will help you.