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> </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?