Home All Groups Group Topic Archive Search About

object variable or with block variable not set error

Author
9 Mar 2006 2:17 AM
Big D
I am receiving the following runtime error(91):
object variable or with block variable not set

I do  not think its relatged to to the sping.dll I am using but how I am
instantiating object but looking for help.


Private Sub SwitchStatus()

    Dim ping As SPing

    Dim txtRemoteHost As String
    txtRemoteHost = "10.128.189.156"

    ping.RemoteHost = ""        <---------------------------------When I
select debug it highlights line.
    MsgBox txtRemoteHost
    ping.RemoteHost = txtRemoteHost
    ping.DoPing

    If ping.RemoteHostIP = "" Then
        MsgBox "Could not resolve host " + ping.RemoteHost
    End If

    Select Case ping.ReplyCode
    Case 0
        IsOnline = True
    Case Else
        IsOnline = False
    End Select

End Sub

Author
9 Mar 2006 2:29 AM
Michael C
ping = new sping
Author
9 Mar 2006 3:55 AM
Bob Butler
"Michael C" <nospam@nospam.com> wrote in message
news:umnoGCyQGHA.3972@TK2MSFTNGP10.phx.gbl
> ping = new sping

or, in VB,
Set ping = new sping

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
9 Mar 2006 6:01 AM
Michael C
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:O1HFQ1yQGHA.792@TK2MSFTNGP10.phx.gbl...
> "Michael C" <nospam@nospam.com> wrote in message
> news:umnoGCyQGHA.3972@TK2MSFTNGP10.phx.gbl
>> ping = new sping
>
> or, in VB,
> Set ping = new sping

I'm always forgetting the Set, another source of vb bugs.....

Michael