Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2005, 04:39 PM
Authorized User
 
Join Date: Jul 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error 91

Hi,
could you help me, plese:
 I have a code,whitch makes autologin. But this code is function only once by run. Twice and more is runtime error 91.

Here is my code:
Private Sub Main()
Dim ie As Object

Dim adresa

adresa = "http://px2.xchat.centrum.cz/~guest~/modchat?op=homepage" 'url,where is login form
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate adresa

Do While ie.Busy
DoEvents
Loop

ie.Visible = True

ie.Document.All("u_name").Value = "a_nick" 'without this line of code makes always

'Me.Hide
Set ie = Nothing

End Sub

 
Old July 29th, 2005, 05:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

error 91 is "Object variable or With block variable not set ", in your code there are only two objects thate are used: ie (from CreateObject) and ie.Document
The only way to know what is happening is to debug the code. Put a breakpoint at the beginning of Main, start with a full compile (Ctrl+F5) and when the debugger stops at the breakpoint step through your code line by line using F8

Marco
 
Old July 30th, 2005, 04:36 AM
Authorized User
 
Join Date: Jul 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.A man help me whit this, here repir code:

Option Explicit

Sub main()

    Dim n

    For n = 1 To 2
        Call doh
    Next

End Sub

Sub doh()

    Dim ie As Object

    Dim adresa

    adresa = "http://px2.xchat.centrum.cz/~guest~/modchat?op=homepage" 'url,where is login form
    Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate adresa

    Do While ie.READYSTATE <> 4
        DoEvents
    Loop

    ie.Visible = True

    ie.Document.All("u_name").Value = "a_nick" 'without this line of code makes always

    Set ie = Nothing

End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 91 GVBGVB Excel VBA 2 April 4th, 2008 12:56 AM
error 91 skrj02 Excel VBA 4 May 7th, 2007 11:01 AM
error 91 issues. kd8con Beginning VB 6 1 October 30th, 2006 09:50 AM
Runtime error 91: Apjong Beginning VB 6 1 June 7th, 2006 09:47 AM
Ch4 Runtime Error 91 using db source code zip file Matrix_zero BOOK: Beginning Access 2003 VBA 0 March 1st, 2005 08:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.