P
Peter Danes
I have a button on a form which opens an instance of IE. The details are
that I feed a magazine title to a Google search string to allow the user to
try to find an ISSN number for the magazine. The code is here.
Static IEGoogle As Object
....
If IEGoogle Is Nothing Then
Set IEGoogle = CreateObject("InternetExplorer.Application")
IEGoogle.Visible = True
End If
IEGoogle.Navigate2 "http://www.google.com/search?hl=cs&q=ISSN+"" & .......
etc.
The code works fine. I put in the Nothing test to make sure that I don't
create an new instance of IE for every search - constantly openning new
windows that the user has to keep closing is very annoying behavior for an
application, so I open it once and then re-use it for every subsequent call.
The problem is if the user DOES close the IE instance. This is entirely
possible, since the search simply opens a page of Google search results.
There is no further code to scan Google's results or anything like that. The
user must look through the offerings, possibly clicking on links to
investigate further, getting sidetracked and all the usual stuff that
happens when you start wandering around web pages. They can then easily
return to the Access app by closing the IE window. Subsequent calls then
crash, since my object variable is not Nothing, but the thing it was
pointing to has vanished. I get an error telling me that the called object
has disconnected from its clients. Is there a way to test the object
variable to detect whether its target is still alive?
--
Pete
This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.
that I feed a magazine title to a Google search string to allow the user to
try to find an ISSN number for the magazine. The code is here.
Static IEGoogle As Object
....
If IEGoogle Is Nothing Then
Set IEGoogle = CreateObject("InternetExplorer.Application")
IEGoogle.Visible = True
End If
IEGoogle.Navigate2 "http://www.google.com/search?hl=cs&q=ISSN+"" & .......
etc.
The code works fine. I put in the Nothing test to make sure that I don't
create an new instance of IE for every search - constantly openning new
windows that the user has to keep closing is very annoying behavior for an
application, so I open it once and then re-use it for every subsequent call.
The problem is if the user DOES close the IE instance. This is entirely
possible, since the search simply opens a page of Google search results.
There is no further code to scan Google's results or anything like that. The
user must look through the offerings, possibly clicking on links to
investigate further, getting sidetracked and all the usual stuff that
happens when you start wandering around web pages. They can then easily
return to the Access app by closing the IE window. Subsequent calls then
crash, since my object variable is not Nothing, but the thing it was
pointing to has vanished. I get an error telling me that the called object
has disconnected from its clients. Is there a way to test the object
variable to detect whether its target is still alive?
--
Pete
This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.