Click here to Skip to main content
15,867,851 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want to open a login page in google chrome called https://services.gst.gov.in/services/login
and the code should fill automatically the password and id

While i execute the following code , in the following line error message is coming
VB
Set IE = CreateObject("Google chrome.Application")


Thanks for your reply

What I have tried:

VB
Sub loginChrome()
Dim IE As Object
Set IE = CreateObject("Google chrome.Application")
IE.Visible = True
IE.Navigate "https://services.gst.gov.in/services/login"

Do
If IE.ReadyState = 4 Then
IE.Visible = False
Exit Do
Else
DoEvents
End If
Loop
'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
IE.Visible = True
'Send logon information
SendKeys "my username"
SendKeys "{TAB}"
SendKeys "my password"
End Sub
Posted
Updated 12-Sep-19 0:30am
v2
Comments
Richard MacCutchan 12-Sep-19 6:21am    
What error message?
phil.o 12-Sep-19 6:36am    
[Irony on] You are right to store such sensitive information in a clear-text script. This does not represent any security risk. [Irony off]
If Indian government made it impossible to automate logins on their site with common browser functionalities, there may be a reason, don't you think?
MadMyche 12-Sep-19 6:53am    
I love this line... just change the program name and try to use the functions of the old
Set IE = CreateObject("Google chrome.Application")

1 solution

First of all, Chrome does not provide a way for OLE automation[^].

You may try to use Selenium Wrapper for such of requirements. See:
How To Automate Firefox Or Chrome With Excel VBA And Selenium[^]
fill out form using vba and chrome - Stack Overflow[^]
 
Share this answer
 
Comments
Member 14588327 17-Sep-19 5:44am    
Thanks for the reply
Maciej Los 17-Sep-19 5:47am    
You're very welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900