Object doesn't support this property or method 
Author Message
 Object doesn't support this property or method

Hi there,

I am having difficulty with a problem that I hope someone has solved in the
past

In the following snippet of code (part of a sub), I open a new browser
window and save a reference to it. Then, using the Document Object Model (as
I understand it) I step down through the hiearchy trying to get a reference
to an OCX in the html page. The OCX is placed in the page with an <Object>
tag and has a name assigned to it via the parameter NAME="VBFORM".

set projFormx = window.open("testocx.htm", "",
"scrollbars=no,status=no,toolbar=no,menubar=no,resizeable=no,width=570,heigh
t=670")
set myDocx = projFormx.document
set myAllx = myDocx.all
set myObjx = myAllx.VBFORM

What happens is that the script fails on the last line of this snippet,
where it tries to reference the OCX in the all collection. A message box
pops up saying that

Object doesn't support this property or method

and further in the script where I try to use the myObjx to call methods on
the object, this will also fail.

The problem I have is particulary damning because it only occurs the first
time in each Explorer session that I execute the code in the sub. Subsequent
times, this problem does not happen. However, we cannot exactly say to our
client that he only has to put up with the error message the first time in
each session.

I suspect that the problem is occuring because the testocx.htm is trying to
reference an object (named VBFORM) which may not have finished loading yet
and so it fails. However, when the second, third or nth time that the sub is
called, the VBFORM object may already be in a cache or in memory or
something so it loads without error messages. Being as I'm pretty certain
that VBScript is NOT a threaded langauge, we cannot start a thread which
loads the page and join() the thread after it completes so that the line

set myObjx = myAllx.VBFORM

results in a valid call. Is there another way to solve this? Any help would
be appreciated.

Cesar



Mon, 29 Jan 2001 03:00:00 GMT  
 Object doesn't support this property or method
you could add some code like:
if (projFormX.document.readyState == "complete") then
    myObjX = projFromX.document.all.VBFORM
end if

Quote:

>Hi there,

>I am having difficulty with a problem that I hope someone has solved in the
>past

>In the following snippet of code (part of a sub), I open a new browser
>window and save a reference to it. Then, using the Document Object Model
(as
>I understand it) I step down through the hiearchy trying to get a reference
>to an OCX in the html page. The OCX is placed in the page with an <Object>
>tag and has a name assigned to it via the parameter NAME="VBFORM".

>set projFormx = window.open("testocx.htm", "",
>"scrollbars=no,status=no,toolbar=no,menubar=no,resizeable=no,width=570,heig
h
>t=670")
>set myDocx = projFormx.document
>set myAllx = myDocx.all
>set myObjx = myAllx.VBFORM

>What happens is that the script fails on the last line of this snippet,
>where it tries to reference the OCX in the all collection. A message box
>pops up saying that

>Object doesn't support this property or method

>and further in the script where I try to use the myObjx to call methods on
>the object, this will also fail.

>The problem I have is particulary damning because it only occurs the first
>time in each Explorer session that I execute the code in the sub.
Subsequent
>times, this problem does not happen. However, we cannot exactly say to our
>client that he only has to put up with the error message the first time in
>each session.

>I suspect that the problem is occuring because the testocx.htm is trying to
>reference an object (named VBFORM) which may not have finished loading yet
>and so it fails. However, when the second, third or nth time that the sub
is
>called, the VBFORM object may already be in a cache or in memory or
>something so it loads without error messages. Being as I'm pretty certain
>that VBScript is NOT a threaded langauge, we cannot start a thread which
>loads the page and join() the thread after it completes so that the line

>set myObjx = myAllx.VBFORM

>results in a valid call. Is there another way to solve this? Any help would
>be appreciated.

>Cesar



Mon, 29 Jan 2001 03:00:00 GMT  
 Object doesn't support this property or method

Quote:

>you could add some code like:
>if (projFormX.document.readyState == "complete") then
>    myObjX = projFromX.document.all.VBFORM
>end if

Thanks a whole bunch, Steve.

I tried your suggestion and it worked perfectly (I only had to translate the
javascript syntax into VBScript - required for the particular project I'm
working on).

Again, thanks a lot.

Cesar



Tue, 30 Jan 2001 03:00:00 GMT  
 Object doesn't support this property or method

Quote:

> Thanks a whole bunch, Steve.

> I tried your suggestion and it worked perfectly (I only had to translate the
> javascript syntax into VBScript - required for the particular project I'm
> working on).

> Again, thanks a lot.

> Cesar

Oops, sorry Steve. You already had it in VBScript. What I did do was to
change
it to a while ... wend contruct rather than an if ... then contruct.

Thanks just the same,

Cesar



Tue, 30 Jan 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Object doesn't support this property or method : 'DTSGlobalVariables(...).Value.Open

2. Object doesn't support this property or method

3. Object doesn't support this property or method

4. Object doesn't support this property or method

5. Sample code: Object doesn't support this property or method

6. Object doesn't support this property or method

7. Object doesn't support this property or method

8. ASP Error on Session.Contents : Object doesn't support this property or method

9. Object doesn't support this property or method

10. Help!- 438- Object doesn't support this property or method

11. Object doesn't support this property or method

12. Object doesn't support this property or method

 

 
Powered by phpBB® Forum Software