LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default IE Automation

It might not do that much speed-wise but I'm thinking you don't need
to use the
SET element USE element
structure. I mean, you could just use the element sraight away:

with IE.Document
..getelementsbyname("txtCID").Item(0).Value = VIP
..getelementbyid("btnSearch").Click
Cells(J, "B").Value
= .getelementbyid("dtgSearchResult_ctl03_lbldtgCID") .innertext
end with


On Jan 8, 11:10*am, "fi.or.jp.de" wrote:
On Jan 8, 5:43*am, James Ravenswood
wrote:





On Jan 5, 6:59*pm, "fi.or.jp.de" wrote:


Hi All,


I need some help to run my code faster. ( Excel to Web Automation )


The bloew codes logs in web site & gets the status, for the search
value mentioned in col A


I want to run for 300 hundred records, I can do loop BUT is there any
way get the results very fast. ???


Currenty It takes 40 records per minute.


Function web_test()


Set IE = New InternetExplorer


URL = confidential
IE.Visible = True


IE.Navigate URL


Do While IE.ReadyState < 4 Or IE.Busy = True
* *DoEvents
Loop


Set ENTID = IE.Document.getelementsbyname("txtPersonnelNumber" )
Set PWD = IE.Document.getelementsbyname("txtPassword")
Set FORM = IE.Document.getelementbyid("btnLogIn")


With login
* * ENTID.Item(0).Value = .username_tx
* * PWD.Item(0).Value = .password_tx
* * FORM.Click
End With


Do While IE.ReadyState < 4 Or IE.Busy = True
* *DoEvents
Loop


IE.Navigate2 "Confidential 2.aspx"


Do While IE.ReadyState < 4 Or IE.Busy = True
* *DoEvents
Loop


VIP = Trim(Cells(1, "a").Value)


Set FNAME = IE.Document.getelementsbyname("txtCID")
* * FNAME.Item(0).Value = VIP


* * Set SRCH = IE.Document.getelementbyid("btnSearch")
* * SRCH.Click


Do While IE.ReadyState < 4 Or IE.Busy = True
* *DoEvents
Loop


Set ID_ID =
IE.Document.getelementbyid("dtgSearchResult_ctl03_ lbldtgCID")
*Cells(I, "B").Value = ID_ID.innertext


End Function


Do you need to open a new IE in the loop? *Can you open it just once
and navigate in the loop?


I don't need to open new IE.
I want to loop, here's my code

For J = 1 to Cells(Rows.count,"A").end(xlup).row

VIP = Trim(Cells(J, "a").Value)

Set FNAME = IE.Document.getelementsbyname("txtCID")
* * FNAME.Item(0).Value = VIP

Set SRCH = IE.Document.getelementbyid("btnSearch")
* * SRCH.Click

Do While IE.ReadyState < 4 Or IE.Busy = True
* *DoEvents
Loop

Set ID_ID =
IE.Document.getelementbyid("dtgSearchResult_ctl03_ lbldtgCID")
* Cells(J, "B").Value = ID_ID.innertext

Next J- Hide quoted text -

- Show quoted text -


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automation Sherees Excel Discussion (Misc queries) 4 December 11th 09 09:59 PM
Automation Bob Barnes Excel Programming 2 May 8th 08 10:25 PM
Automation Q Rick Excel Programming 0 August 30th 07 08:02 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Excel Programming 0 July 19th 07 10:10 PM
Automation [email protected] Excel Programming 0 December 12th 03 02:52 PM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"