SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    New Member
    Join Date
    Jul 2013
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Question Need VBA code to import web object properites into excel

    Hi Techies,

    I have written QTP code to retrieve all current web page object propeties into excel sheet. I have applied through child object method.

    Now my requirement is like this,

    I need to covert the same code into EXcel VBA macro code. So that we can avoid QTP dependency as well. Now am strucking in finding alternative for QTP child objects method..

    Can anyone of you help me to solve this issue.

    Lookfing for your reply

  2. #2
    New Member
    Join Date
    Jul 2013
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Please find the sample code below for QTP........But i need to replace it with VBA Macro code. Below bordered item need to change in VBA
    ----------------------------------------------------------------------------------------------------------

    filename = "C:\Users\203627\Desktop\Book2.xlsx"
    sheetname="Sheet2"
    'call writeinexcel(filename,1,"name","Sheet1",10)
    Set objExcel=CreateObject("Excel.Application")
    Set objWorkbook=objExcel.Workbooks.open(filename)
    Set worksheet =objExcel.sheets.item(sheetname)
    Worksheet.cells(1,1).value="CLASS"
    Worksheet.cells(1,2).value="NAME"
    Worksheet.cells(1,3).value="HTML ID"
    Worksheet.cells(1,4).value="INNERHTML"
    Worksheet.cells(1,5).value="INNERTEXT"
    Worksheet.cells(1,6).value="all items"
    Dim a(350)
    -----------------------------------------------------------------------------------------------------------------------------------
    set p=Browser("[DEV mode - 7.0.0.466]_3").Page("[DEV mode - 7.0.0.466]").Frame("top_frame").ChildObjects
    -----------------------------------------------------------------------------------------------------------------------------------
    ' msgbox p.count
    cnt=0
    For i=2 to p.count-1
    b=p(i).GetTOProperty("micclass")
    c=p(i).GetRoProperty("name")
    d=p(i).GetRoProperty("html id")
    e=p(i).GetRoProperty("innerhtml")
    f=p(i).GetRoProperty("innertext")
    g=p(i).GetRoProperty("outerhtml")
    h=p(i).GetRoProperty("all items")
    If i<1 Then
    a(i)=b
    Worksheet.cells(j,1).value=b
    Worksheet.cells(j,2).value=c
    Worksheet.cells(j,3).value=d
    Worksheet.cells(j,4).value=e
    Worksheet.cells(j,5).value=f
    Worksheet.cells(j,6).value=g
    Worksheet.cells(j,7).value=h
    Else
    For j=2 to Ubound(a)-1
    If a(j)<>b Then
    cnt=cnt+1
    a(cnt)=b
    Worksheet.cells(i,1).value=b
    Worksheet.cells(i,2).value=c
    Worksheet.cells(i,3).value=d
    Worksheet.cells(j,4).value=e
    Worksheet.cells(j,5).value=f
    Worksheet.cells(j,6).value=g
    Worksheet.cells(j,7).value=h
    Exit for
    End If
    Next
    End If
    Next
    objWorkbook.Save
    objExcel.quit
    msgbox "Completed"

  3. #3
    Advanced Member
    Join Date
    May 2006
    Location
    United Kingdom
    Posts
    742
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

  4. #4
    Advanced Member venu.adhikesevan's Avatar
    Join Date
    Jun 2010
    Posts
    517
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    Nice info...Thanks Yogi
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:59 AM.

Copyright BetaSoft Inc.