Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Please Don't mind .i want in detail the real time process i.e in each document what it contains.

1850


after initiating one project for testing, when exacltly QTP tester role starts?

1872


How QA specialist can identify when programmatic descriptions are useful?

2442


How u will do versioning in QTP?

1843


What are the different ways to invoke an application using QTP?

1117


Where we can use the synchronization?

967


Dear sir, i want to perform a QTP automated testing for mechancial engineering software like msc adams, msc nastran this softwares will help for mechanical engineering design analysis>> i know oad runner win runner, test director, QTp>> but i dont know how to use for automation

2041


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

1579


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1972


In qtp, explain what is crypt object

988


unique properties of button,edit box, radio button,check box?

4439


How to capture all the data of a webtable, weblist and combolist using QTP?

3293


What is qtpro? What is quick test pro?

1011


What is the syntax for how to call one script from another?

994


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1414