Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-07-21 05:52:46
Point:250 Replies:7 POST_ID:828360USER_ID:11059
Topic:
Visual Basic Programming;Miscellaneous Programming;JavaScript
When I navigate the bank login website page by VBA with .navigate, and I found there is
no any element ID or type for username and password in the source code of html. It is
javascript function to let user to access the login page. So I need to use sendkey("myloginname")
instead of .document.all("username")="myloginname" to enter my login name in the webpage . The problem is when I run the sendkey("myloginname") in VBA, the "myloginname" is pasted on my VBA code not the location of the login box of the login page I navigate. How Can I control my cursor and move it to the bank page and exact login box?
I tried the sendkey() before, sometimes, it works but sometime it doesn't work as I said above.
it seems it is related to cursor position issue ?
Please veiw the following code espeically with Bold type for the sendkey which will send the
myloginname inside of my banklogin() code.
Please advise
Thanks
My code is here :
-------------------
Sub Banklogin()
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
.navigate "www.mybank.com"
call waiting
sendkey ("myloginname")
myloginname.document.links(6).click 'enter the next page of login
End Sub
Function WAITING(ByRef myIE As SHDocVw.InternetExplorer)
With myIE
Do Until Not .Busy And .readyState = READYSTATE_COMPLETE
Loop
End With
End Function
no any element ID or type for username and password in the source code of html. It is
javascript function to let user to access the login page. So I need to use sendkey("myloginname")
instead of .document.all("username")="myloginname" to enter my login name in the webpage . The problem is when I run the sendkey("myloginname") in VBA, the "myloginname" is pasted on my VBA code not the location of the login box of the login page I navigate. How Can I control my cursor and move it to the bank page and exact login box?
I tried the sendkey() before, sometimes, it works but sometime it doesn't work as I said above.
it seems it is related to cursor position issue ?
Please veiw the following code espeically with Bold type for the sendkey which will send the
myloginname inside of my banklogin() code.
Please advise
Thanks
My code is here :
-------------------
Sub Banklogin()
Dim myIE As SHDocVw.InternetExplorer
Set myIE = Nothing
Set myIE = CreateObject("InternetExplorer.Application")
.navigate "www.mybank.com"
call waiting
sendkey ("myloginname")
myloginname.document.links(6).click 'enter the next page of login
End Sub
Function WAITING(ByRef myIE As SHDocVw.InternetExplorer)
With myIE
Do Until Not .Busy And .readyState = READYSTATE_COMPLETE
Loop
End With
End Function
Author: duncanb7 replied at 2024-07-21 08:13:07
Thanks for all of you to reply this
email
Author: duncanb7 replied at 2024-07-21 08:12:34
Thanks for all of you to reply this
email
Expert: JohnBPrice replied at 2024-07-21 07:34:36
Accepted Solution
Expert: JohnBPrice replied at 2024-07-21 07:29:25
250 points GOOD
Thanks for all of you to reply this
email
Expert: amdefacto replied at 2024-07-21 07:06:49
Thanks for all of you to reply this
email
Author: duncanb7 replied at 2024-07-21 06:14:38
Thanks for all of you to reply this
email
Author: duncanb7 replied at 2024-07-21 06:12:46
Thanks for all of you to reply this
email