Error : Object Required 
Author Message
 Error : Object Required

Hello!
I'm pretty new to VB programming, so maybe my question is quite stupid.

I have a simple VB ActiveX component. All that it does - opens a standard FileOpen dialog and returns a path of a chosen file.
Then in my HTML page I have:

<script language=VBScript>
sub Browse
 Dim FileBrowser
 Dim FileDiv
 Dim strFile
 Set FileBrowser = CreateObject("Project1.FileBrowse")
 Set FileDiv = document.all.item("filediv")
 strFile = FileBrowser.Browse
 MsgBox strFile
 FileDiv.innerText = strFile
 Set FileBrowser = Nothing
end sub
</script>
</HEAD>
<BODY>

<P>&nbsp;</P>
<a href=# onclick=Browse>Browse...</a>
<div id = "filediv" color=blue>
</div>

When I run this in Debug (from VB), it works fine. When I browse the same html without debugging, it opens a FileOpen dialog,but when I close it, I get an error message :
Object Required.

What's the mistery behind this?



Fri, 28 Jun 2002 03:00:00 GMT  
 Error : Object Required

Set FileDiv = document.all.item("filediv")

What's this line? I don't think that's a valid object reference, but it's hard to tell without all the object code.

Steve Taylor

    Hello!
    I'm pretty new to VB programming, so maybe my question is quite stupid.

    I have a simple VB ActiveX component. All that it does - opens a standard FileOpen dialog and returns a path of a chosen file.
    Then in my HTML page I have:

    <script language=vbscript>
    sub Browse
     Dim FileBrowser
     Dim FileDiv
     Dim strFile
     Set FileBrowser = CreateObject("Project1.FileBrowse")
     Set FileDiv = document.all.item("filediv")
     strFile = FileBrowser.Browse
     MsgBox strFile
     FileDiv.innerText = strFile
     Set FileBrowser = Nothing
    end sub
    </script>
    </HEAD>
    <BODY>

    <P>&nbsp;</P>
    <a href=# onclick=Browse>Browse...</a>
    <div id = "filediv" color=blue>
    </div>

    When I run this in Debug (from VB), it works fine. When I browse the same html without debugging, it opens a FileOpen dialog,but when I close it, I get an error message :
    Object Required.

    What's the mistery behind this?



Mon, 01 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Error : Object Required

2. error:object required

3. Error: object required: 'WScript'

4. Error, Object Required "Wscript"

5. Microsoft Jscript runtime error object required

6. File Error: Object Required?

7. error - Object required 'DoCmd'

8. VB4: Error Object required

9. OLE Automation Error/Object Required

10. error object required

11. NEWBIE : Getting Error Object required Can anyone point out whats wrong

12. runtime error object required 'id'

 

 
Powered by phpBB® Forum Software