Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle opening an excel during run time?
#3
Solved: 11 Years, 4 Months ago
Hi,

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
Reply


Messages In This Thread
RE: How to handle opening an excel during run time? - by Rekhapramod - 02-23-2011, 05:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can UFT Handle Detecting Redirects? zunebuggy 0 901 05-28-2020, 06:50 PM
Last Post: zunebuggy
  QTP not recogonising object during run time Lavanya N 2 3,727 10-28-2015, 12:46 PM
Last Post: vinod123
  Writing to Run time data table Neetha 5 12,175 08-27-2015, 10:18 AM
Last Post: supputuri
  Error while opening test run results vkalyankar 3 4,318 11-12-2014, 09:49 AM
Last Post: vinod123
  QTP Stuck at Opening stage TurtleRock 4 3,680 05-27-2014, 08:42 PM
Last Post: mauler69

Forum Jump:


Users browsing this thread: 1 Guest(s)