Hi every body, I am new to QTP.pls help me if anybody knows
the solution.
Here is my doubt:
I have 3 excel sheets in my local drive out of which one is
password protected and i want to get the data of all these
xL's either by importing or by reading the data finally i
have to update this data in the website.(and the site is
secured site)

I tried by importing all XL"s one by one but couldn't do so.
plss send me the code or atleast suggest me the approach.
Thanks in Advance
Padmaja

Answer Posted / swapna

Hi ,
There is simple solution which you need to do is try to
access the excel through by creating the object.
See sample script
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Function HomePage()
Dim fso, Root, HtmlResFile
Dim appExcel
'Defining the File object
Set fso = CreateObject("Scripting.FileSystemObject")
Set appExcel = CreateObject("Excel.Application")

'Setting the path
'Root = "C:\\Documents and Settings\\sragi\\Desktop\\MCGATF-
WALTHAM\\KR2xRegressionSet_Framework\\"
'Root = App.Path + "\KR2xRegressionSet_Framework"
Root = App.Path
ExcelPath = Root + "\\Qtp_Excel_Results\\Results.xlsx"
'Creating html file
Set HtmlResFile = fso.CreateTextFile(Root
+ "\Qtp_Html_Results\Regression_Summary_Results.html",
True, False)
'Closing the Html created file
HtmlResFile.Close
'Opening the above created html file for writing
Set HtmlResFile = fso.OpenTextFile(Root
+ "\Qtp_Html_Results\Regression_Summary_Results.html", 2,
True)
Set appExcel = CreateObject("Excel.Application")
'Open the Result file
appExcel.Visible = True
Set objWorkBook = appExcel.Workbooks.Open(ExcelPath)
'Open the Result file
Set objSheet = appExcel.Sheets(1)
objSheet.Select
With objSheet
TotalExecutedTcs = .Range("C7")
End With
For j = 11 To objSheet.UsedRange.Rows.Count
Status = objSheet.Range("G" & j)
If Status = "Pass" Then
Passcount = Passcount + 1
Else
Failcount = Failcount + 1
End If
Next

TotalPass_Percentage = Round((Passcount * 100) /
TotalExecutedTcs)



TotalFail_Percentage = Round((Failcount * 100) /
TotalExecutedTcs)

'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

this function will read the data from the excel and reports
to the html output. This is not the direct solution of your
problem but the methods which are used will solve your
problem...

Search in google to read the excel which has password
protection. Already I have posted the code in the QTP Blog
earlier.... along with it you can get other experts code...

Thanks..
Happy learning...

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2

1596


tell me abt a time when u had to go above &beyind the call of duty to get the job done

1552


What ate the Technologies supported by QTP?

763


Generic function to search for the unique link in webtable and click on it

2596


Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in

1682






How should I click on the right click menu objects When I trying to add the object properties to the OR.It is showing only Window(Window).Not all the objects of the window. Also while recording I found No script. How to solve this>.

1629


how to create flat file datasubmission in qtp

1998


What is keyword view?

662


If you are testing a web application then what will you test in that application?

1633


What is fragmentation and paging?

1674


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1788


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

1518


what type of values given to objects. EX::Set oBrowser=Description.Create oBrowser(“micclass”).Value=”Browser”

1581


What is a reusable action?

649


How do client side image and server side image work?

1474