Thank you so much.  Sheet.Activate worked. 
 

On Wednesday, June 8, 2016 at 8:07:57 AM UTC-4, [email protected] wrote:

> For Doc Activate
> ------------------------------
> Set Obj=CreateObject("Wscript.shell")
> Obj.AppActivate "Document" ///First name of the Document like if the name 
> is 'QTP Test', dn Put Obj.Appactivate "QTP"
> ****************************************************
> Sheet Activate.
> ----------------------------------------------
> XLobject.ActiveWorkbook.Sheets(2).Select  /// instead od 2 , u can also gv 
> the name of the sheet like "QTPTestDriver"
> ***************************************
>
> If this was you answer dn fine else pls clarify the question. :) 
>
> On Wednesday, June 8, 2016 at 2:53:35 AM UTC+2, [email protected] wrote:
>>
>> Hi,
>>
>> I'm running the following steps to open an excel sheet and then add 
>> values to few cells and then save.
>> My question is how to activate the sheets?  When I run this test, it 
>> doesn't visually show numbers being added but I know numbers are added.
>> You know how we can Activate a word document, can we do the same with 
>> excel sheets?
>>
>> Thanks
>>
>> 'Excel object created here
>>  Set MyExcel=CreateObject("Excel.Application")
>>  MyExcel.Visible = True
>>  
>>  'File_1 is opened
>>  Set WBOOK_1=MyExcel.workbooks.open ("C:\file.xlsx")
>>  
>>  
>>  'Cells in sheet  1 and sheet 2  are compared
>>  Set WBOOK_1= WBOOK_1.Worksheets(1)
>>  Set WBOOK_2= WBOOK_1.Worksheets(2)
>>  
>>  For Each cell In WBOOK_1.UsedRange
>>   If cell.value <> WBOOK_2.Range(cell.address).value Then   
>>    'add a number here
>>   Else
>>    'add a differnt number
>>      End If
>>  
>>  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 [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

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to