See the typo mistake you made...you need to debug each line ...then you will
find that easily...See below highlighted 

 

 

 

Sreedhar Mallipeddi

 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Ajeet Mishra
Sent: Saturday, August 06, 2011 3:01 PM
To: QTP - HP Quick Test Professional - Automated Software Testing
Subject: Re: I was trying to fetch all the cell values from Excel using FSO

 

Hi Guys,

 

No one has any solution?

 

On Aug 6, 2:53 pm, Ajeet Mishra < <mailto:[email protected]>
[email protected]> wrote:

> Hi everyone,

> 

> I was trying to fetch all the values from Excel using FSO and writing 

> these values into notepad. I tried the below code but not getting any 

> success.. Please help...

> 

> Dim objExcel, objWkBook, objSheet

> Set objExcel = CreateObject("Excel.Application") Set objWkBook = 

> objExcel.Workbooks.Open("C:\Results2.xls")

> Set objSheet = objWkBook.Sheets(1)

> For i=1 to 100

>  For j=1 to 4

> If objsheet.cells(i,j).value="" Then

> msgbox "blank value"

> exitaction

> else

> CellValue= objsheet.cells(i,j).value

> Set obj= Createobject("Scripting.FilesystemObject")

> Set Text=Obj.createtextfile("C:\Results2.txt")

> For each CellValue In objsheet.cells(i,j).value Text.Write CellValue 

> Set Text=Nothing Set obj=Nothing Next End If Next Next

> 

> Its reading all the cell values when I use the code without writing in 

> notepad like this:

> 

> Dim objExcel, objWkBook, objSheet

> Set objExcel = CreateObject("Excel.Application") Set objWkBook = 

> objExcel.Workbooks.Open("C:\Results2.xls")

> Set objSheet = objWkBook.Sheets(1)

> For i=1 to 100

>  For j=1 to 4

> If objsheet.cells(i,j).value="" Then

> msgbox "blank value"

> exitaction

> else

> CellValue= objsheet.cells(i,j).value

> msgbox CellValue

> End If

> Next

> Next

 

--

You received this message because you are subscribed to the Google "QTP - HP
Quick Test Professional - Automated Software Testing"

group.

To post to this group, send email to  <mailto:[email protected]>
[email protected] To unsubscribe from this group, send email to

 <mailto:[email protected]>
[email protected]

For more options, visit this group at

 <http://groups.google.com/group/MercuryQTP?hl=en>
http://groups.google.com/group/MercuryQTP?hl=en

-----

No virus found in this message.

Checked by AVG -  <http://www.avg.com> www.avg.com

Version: 10.0.1390 / Virus Database: 1518/3810 - Release Date: 08/04/11

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to