02-23-2011, 05:56 PM
Hi,
Try to use the below code
Regards,
RP
Try to use the below code
Code:
strFileName="C:\Documents and Settings\qtp\Desktop\Login_Details.xls"
strSQLStatement="Select * from [Dummy$]'"
Dim objAdCon, objAdRs
Set objAdCon = CreateObject("ADODB.Connection")
objAdCon.Open "DRIVER={Microsoft Excel Driver (*.xls)};DBQ="&strFileName &";Readonly=True"
Set objAdRs = CreateObject("ADODB.Recordset")
objAdRs.Open strSQLStatement, objAdCon,3
MsgBox objAdRs.RecordCount
Regards,
RP