Results 1 to 20 of 20

Thread: [RESOLVED] Auto Login Issue

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    Resolved [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.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    Re: Auto Login Issue

    Please advice If not allowed, I will removed it. Thank you for your advice.

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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:
    1. brwWebBrowser.Document.Forms(0).submit() = True

    should be written as:

    vb Code:
    1. 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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    Re: Auto Login Issue

    I did try it Dear, Same error message! Any advice please?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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.

  8. #8
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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

  10. #10
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Auto Login Issue

    Quote Originally Posted by brss View Post
    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.

    Quote Originally Posted by brss View Post
    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

  11. #11
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Auto Login Issue

    Use internet explorer

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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.

  13. #13
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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.

  15. #15
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Auto Login Issue

    you have Microsoft Internet Controls referenced right?
    Last edited by Max187Boucher; Aug 18th, 2012 at 12:17 AM.

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    Re: Auto Login Issue

    Hello Max, How are you Today? Yes I referenced MIC. Thank you

  17. #17
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Auto Login Issue

    Sorry was kinda busy tonight i will help you for sure tomorrow

  18. #18
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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.

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2012
    Location
    I'm living in VBForum bcz its members deserve respect and appreciation
    Posts
    333

    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
  •  



Click Here to Expand Forum to Full Width