A family of Microsoft relational database management systems designed for ease of use.
Dim GC As clsGC
is what is expected. I bet you named your class clsWhatever which is why the compile error occurs.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
Wondering if it is possible to log into a website using code?
I have a button to hyperlink to a website, can I include in the code to insert my username and password into the login fields?
The reason I want to do this is, when in the field on my Ultrabook, I want to reduce time, clicks and the appearance of being clumsy when in front of a customer.
Any help would be appreciated.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Dim GC As clsGC
is what is expected. I bet you named your class clsWhatever which is why the compile error occurs.
Check this out: http://www.access-programmers.co.uk/forums/showthread.php?t=200838
Thanks Tom,
I had a look at the site and will give it a try in a couple of days. Fitting an alarm to car ATM.
Will let you now how I go with the information.
Scott
Well Tom its been a while, sorry about that.
I copied the code from the website in the hyper link. I changed IE to GC and InternetExplorer to GoogleChrome and created a class module for part of the code.
I get an error: "User-defined type not defined." at Dim GC As clsGC
As a beginner it looks like I need to add a Reference, but I don't know which one to use.
Can anyone tell me what I need to do to get this working please?
The code is as follows:
Sub loginSite()
On Error GoTo errhandler
Dim GC As clsGC
Dim input_user As HTMLInputElement
Dim input_pass As HTMLInputElement
Dim docDOM As HTMLDocument
Set GC = New clsGC
GC.Navigate ("http://www.********************************")
Do Until GC.DocumentLoaded
DoEvents
Loop
Set docDOM = GC.document
Set input_user = docDOM.getElementsByName("username").Item(Index:=0)
Set input_pass = docDOM.getElementsByName("password").Item(Index:=0)
input_user.Value = "scott@************"
input_pass.Value = "*************"
CLASS MODULE
option Compare Database
Option Explicit
Dim doc_loaded As Boolean
Dim WithEvents GC As GoogleChrome
Private Sub Class_Initialize()
On Error Resume Next
GC.Visible = True
If Err.Number <> 0 Then
Set GC = New GoogleChrome
GC.Visible = True
End If
End Sub
Public Sub Navigate(ByVal URL As String)
doc_loaded = False
GC.Navigate URL
End Sub
Private Sub GC_documentcomplete(ByVal pDisp As Object, URL As Variant)
doc_loaded = True
End Sub
Public Property Get DocumentLoaded() As Boolean
DocumentLoaded = doc_loaded
End Property
Public Property Get document() As HTMLDocument
Setdocument = GC.document
End Property
Exit Sub
errhandler:
Debug.Print "error" & Err.Number
Debug.Print Err.Description
End Sub
Check this out: http://www.access-programmers.co.uk/forums/showthread.php?t=200838
Thanks Tom,
I had a look at the site and will give it a try in a couple of days. Fitting an alarm to car ATM.
Will let you now how I go with the information.
Scott
This question has not been answered yet, anybody?