-
Jul 16th, 2012, 01:18 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Auto Login Issue
Hello I'm looking forward to register to vbforums.com as Auto Login.
Code1 work fine but after I register as Auto Login Error Msg occured " Object variable or with block variable not set " and highlight on code line below. Any help would be appreciate. Thank you All. your replay appreciate in advance.
Code:
brwWebBrowser.Document.All("vb_login_username").Value = "brss"
Code:
Code1
Private Sub Form_Load()
Me.Show: DoEvents
brwWebBrowser.Navigate "http://www.vbforums.com/login.php?"
DoEvents
While brwWebBrowser.Busy = True
DoEvents
Wend
brwWebBrowser.Document.All("vb_login_username").Value = "brss"
brwWebBrowser.Document.All("vb_login_password").Value = "gfggfggf"
brwWebBrowser.Document.Forms(0).submit() = True
DoEvents
While brwWebBrowser.Busy = True
DoEvents
Wend
End Sub
Last edited by brss; Jul 16th, 2012 at 02:43 AM.
-
Jul 16th, 2012, 05:38 AM
#2
Re: Auto Login Issue
I don't think that kind of stuff is allowed here. Someone correct me if I am wrong.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 16th, 2012, 05:43 AM
#3
Thread Starter
Hyperactive Member
Re: Auto Login Issue
Please advice If not allowed, I will removed it. Thank you for your advice.
-
Jul 16th, 2012, 06:20 AM
#4
Re: Auto Login Issue
Well, the above problem you are experiencing with you code must have something to with the browser control itself since I can send the data to the page 1 out of 10 times. Yes, I experience the same error the other times I try to send the data to the page.
Edit:
This line:
vb Code:
brwWebBrowser.Document.Forms(0).submit() = True
should be written as:
vb Code:
brwWebBrowser.Document.Forms(0).submit (True)
I am able to automatically login using your code but like I said for some reason sometimes the above error occurs.
Last edited by Nightwalker83; Jul 16th, 2012 at 06:37 AM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 16th, 2012, 06:41 AM
#5
Thread Starter
Hyperactive Member
Re: Auto Login Issue
Thank you for your time spending, I'm going now try it. one more question? If i have name like
brwWebBrowser.Document.All("vb_login_password").Value = "brss brss" ' name with space!! it that space going to give any error?
-
Jul 16th, 2012, 06:45 AM
#6
Thread Starter
Hyperactive Member
Re: Auto Login Issue
I did try it Dear, Same error message! Any advice please?
-
Jul 16th, 2012, 06:49 AM
#7
Thread Starter
Hyperactive Member
Re: Auto Login Issue
I re try 3 times the auto login it's working but in 4th try gave me same error Msg. above. I there any other powerful code to do Auto Login? Thank you Sire for your time.
-
Jul 16th, 2012, 07:35 AM
#8
Re: Auto Login Issue
AFAIK the terrms and conditions for using most web sites forbid 'automatic' logons. This site gives you the 'remember me' option when you login which serves the same purpose.
-
Jul 16th, 2012, 07:54 AM
#9
Thread Starter
Hyperactive Member
Re: Auto Login Issue
Thank you for replay, Such helpful. But I'm member with Site that " Remember me " option not available! and I Gave vbforums as example. Again Thank you for your time. Brss
-
Jul 16th, 2012, 07:00 PM
#10
Re: Auto Login Issue
Originally Posted by brss
Thank you for your time spending, I'm going now try it. one more question? If i have name like
brwWebBrowser.Document.All("vb_login_password").Value = "brss brss" ' name with space!! it that space going to give any error?
Like I said above it is probably something to do with the Microsoft browser control itself.
Originally Posted by brss
Thank you for replay, Such helpful. But I'm member with Site that " Remember me " option not available! and I Gave vbforums as example. Again Thank you for your time. Brss
I think all forums would be the same in regards to logging in whether it's vbforums or another forum.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 17th, 2012, 08:51 AM
#11
-
Aug 17th, 2012, 03:53 AM
#12
Thread Starter
Hyperactive Member
Re: Auto Login Issue
[/QUOTE]Max187Boucher;4200260]Use internet explorer[/QUOTE]
Hello Max, Could you please provide an example powerful than what i' posting below or if you can modefied it a little bit because sometimes it's working and sometimes not. Thank you very much.
Code:
Dim ieApp As InternetExplorer
Dim iePage As HTMLDocument
Set ieApp = New InternetExplorer
ieApp.Visible = True
ieApp.Navigate "https://dealers.asiacell.net"
'wait for page to load
Do Until ieApp.ReadyState = READYSTATE_COMPLETE
Loop
Set iePage = ieApp.Document
iePage.Forms(0).Item("username").Value = "brss brss"
iePage.Forms(0).Item("form[password]").Value = "password"
iePage.Forms(0).Item("submit_login").Click
ieApp.Navigate "https://www.asiacell.net"
Do Until ieApp.ReadyState = READYSTATE_COMPLETE
Loop
End Sub
Last edited by brss; Aug 17th, 2012 at 04:13 AM.
Reason: Add website i'm trying to log.
-
Aug 17th, 2012, 09:11 AM
#13
Re: Auto Login Issue
Your code looks fine i think you need to wait until page is fully loaded maybe put the sleep api after you login.click you put Sleep 3000 ... Of course you need to dexlare the sleep api first or sleep wont work... I might be able to help you tonight when i get home
-
Aug 17th, 2012, 11:14 PM
#14
Thread Starter
Hyperactive Member
Re: Auto Login Issue
Hello There, I did test code and i got error as shown in attachment. Thank you
Last edited by brss; Sep 18th, 2013 at 12:03 PM.
-
Aug 17th, 2012, 11:53 PM
#15
Re: Auto Login Issue
you have Microsoft Internet Controls referenced right?
Last edited by Max187Boucher; Aug 18th, 2012 at 12:17 AM.
-
Aug 18th, 2012, 01:40 AM
#16
Thread Starter
Hyperactive Member
Re: Auto Login Issue
Hello Max, How are you Today? Yes I referenced MIC. Thank you
-
Aug 18th, 2012, 02:18 AM
#17
Re: Auto Login Issue
Sorry was kinda busy tonight i will help you for sure tomorrow
-
Aug 22nd, 2012, 12:29 AM
#18
Re: Auto Login Issue
sorry i am also busy with my new little project
if you could post the form with the code in it i would look at it a bit more
i tried to simulate your code a bit but it worked for me... so i am not sure why it is not working post your form project (not ALL of them but the one with the code in it) i will look tomorrow for sure this time
-
Aug 22nd, 2012, 11:55 AM
#19
Thread Starter
Hyperactive Member
Re: Auto Login Issue
I'm sorry and apologize to you brother, I will not send it until you finish your "little project", I don't want to be rude you kinda busy,just put me onhold until you get some space for me. You seems very nice gentelman. So please when you feel you have time for me just let me know to send you the SAMPLE. Brss
Last edited by brss; Aug 22nd, 2012 at 12:30 PM.
-
Aug 24th, 2012, 06:56 AM
#20
Thread Starter
Hyperactive Member
Re: [RESOLVED] Auto Login Issue
Hi All, Here is full code used to Auto login, Modified by Max187Boucher. I post it here so anyone can get benefit in return. Please folk if any one found this code useful Rate Max187Boucher. Thank you
Code:
Option Explicit
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private IE As Object
Private Sub Form_Load()
On Error GoTo IE_Error
IE.Visible = True 'Make sure is Visible AND also checks if IE is Set... if not set then goto IE_Error
'Here below you would put your code to control document example below
Debug.Print IE.Document.Body.InnerHTML
'More code here if needed
Exit Sub
IE_Error: 'Error 462(Window Closed) - Error 91(Object Not Set)
If Not Err.Number = 462 And Not Err.Number = 91 Then Exit Sub 'Exit if not error 462 or 91
'If is Error 462 or 91 then Create new Window
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Silent = True
IE.Navigate "https://put here your website"
Sleep 2000 'If the code below creates an error then change "Sleep 3000"
IE.Document.Forms.Form1.txtUsername.Value = "UserNameHere"
IE.Document.Forms.Form1.txtPassword.Value = "PassWordHere"
IE.Document.Forms.Form1.btnLogin.Click
Sleep 2000 'You do not want to rush login in because you will try to use document while still loging in...same as above
End Sub
Last edited by brss; Aug 24th, 2012 at 07:00 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|