Re: Is object created?
From: Ed (Ed_Millis_at_NOSPAM.Hotmail.com)
Date: 06/07/04
- Next message: Björn Holmgren: "Re: Invoke Acrobat Reader from VB Application"
- Previous message: Ralph: "Re: Custom VB OCX"
- In reply to: MacDermott: "Re: Is object created?"
- Next in thread: Gale Green: "Re: Is object created?"
- Reply: Gale Green: "Re: Is object created?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Jun 2004 06:59:51 -0700
Perhaps you could use a property of the object, rather than the object
itself. I had to find a way to detect if my object had suddenly become
Nothing - that is, the user closed the file without using the Exit button
that would also close the VB app. Not being very experienced at this, I
probably went the long and tedious way around, but I set a Timer function to
set the name of the object to a string. If it errored, the file was
closed - I detected the error and shut down the VB app.
Ed
"MacDermott" <macdermott@NoSpam.com> wrote in message
news:%23h9b04zSEHA.4016@TK2MSFTNGP10.phx.gbl...
> As I understand it, if your object variable is declared using New, it will
> be instantiated whenever you reference it.
> Thus in that case
> oEmp Is Nothing
> will always evaluate to False, because the reference to oEmp instantiates
> it.
>
> If you are instantiating it some other way, this may not be a
consideration.
>
> HTH
> - Turtle
>
> "eagletender" <eagletender2001@yahoo.com> wrote in message
> news:10c3tq1dlde3n59@corp.supernews.com...
> > How can you tell if an object has been initialized? I have tried
> > isempty(oEmp), isnull(oEmp), isobject(oEmp), isMissing(oEmp) and none of
> > them work yet I still get the error Object variable or With Variable not
> > set, yet it should have not even gotten that far. I used Isempty
> > successfully with ASP but doesn't work with VB. Thanks.
> >
> >
>
>
- Next message: Björn Holmgren: "Re: Invoke Acrobat Reader from VB Application"
- Previous message: Ralph: "Re: Custom VB OCX"
- In reply to: MacDermott: "Re: Is object created?"
- Next in thread: Gale Green: "Re: Is object created?"
- Reply: Gale Green: "Re: Is object created?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|