Hi,
I want to create an object that named "objIE" with:
Set objIE = CreateObject("InternetExplorer.Application")
but i wish this object will available for other functions in my
application (vbs in hta).

I thought
Public Set objIE = CreateObject("InternetExplorer.Application")
may work.
Unfortunately it wasn't. How can i make an object public to make it
available for external functions.
Thanks.
Caglar ORHAN

Re: How to set a public object variable? by Anthony

Anthony
Thu Aug 17 03:56:54 CDT 2006


"caglaror" <caglaror@gmail.com> wrote in message
news:1155803754.216235.134770@h48g2000cwc.googlegroups.com...
> Hi,
> I want to create an object that named "objIE" with:
> Set objIE = CreateObject("InternetExplorer.Application")
> but i wish this object will available for other functions in my
> application (vbs in hta).
>
> I thought
> Public Set objIE = CreateObject("InternetExplorer.Application")
> may work.
> Unfortunately it wasn't. How can i make an object public to make it
> available for external functions.
> Thanks.
> Caglar ORHAN
>

Dim objIE

Outside of any functions or Classes will put in the global scope. I would
recommend you use a naming convention to identifiy it as global. gobjIE for
example.



Re: How to set a public object variable? by caglaror

caglaror
Thu Aug 17 04:57:40 CDT 2006

No. Not working. When i use DIM objIE it gets no difference.
----------
How can we make an object available from all external functions in
vbscript (at hta)?


Re: How to set a public object variable? by Joe

Joe
Thu Aug 17 08:34:18 CDT 2006

You will have to show the script where you declare the variable.

--

Joe Fawcett (MVP)

http://joe.fawcett.name
"caglaror" <caglaror@gmail.com> wrote in message
news:1155808660.909270.219120@m73g2000cwd.googlegroups.com...
> No. Not working. When i use DIM objIE it gets no difference.
> ----------
> How can we make an object available from all external functions in
> vbscript (at hta)?
>



Re: How to set a public object variable? by caglaror

caglaror
Thu Aug 17 16:42:56 CDT 2006

Public Function RunScript()
Set mesajboard =3D document.getElementById("mesajimiz")

ccSleep(3)
Set objIE =3D CreateObject("InternetExplorer.Application")
'objIE.visible=3Dtrue
objIE.Navigate("http://eczane.ssk.gov.tr/eczane/basla")
objIE.ToolBar =3D 0
objIE.StatusBar =3D 0
objIE.width=3D"900"
objIE.height=3D"800"
objIE.top=3D"80"
objIE.left=3D"75"

objIE.Visible =3D True
Do Until objIE.busy
readyx=3DobjIE.ReadyState
ccSleep(1)
readyxcount=3Dreadyxcount+1
if readyxcount =3D 10 then
objExplorer.stop
objIE.close
end if
mesajboard.innerHTML=3Dreadyxcount & " saniye oldu...!"
mesajboard.innerHTML=3D"<font size=3D1 color=3Dred>Pencerenin tamamen
y=FCklenmesi bekleniyor...!</font>"
Loop
'MsgBox(objIE.document.readyState)
Set sskdoc=3DobjIE.document
sskdoc.title=3D"EOP kontrol=FCnde SSK islemleri devam ediyor..."
sskdoc.all.tags("INPUT")(1).value=3D"0600100897"
sskdoc.all.tags("INPUT")(2).value=3D"12345678" ' ofcourse wrong pass
sskdoc.all.tags("INPUT")(3).focus()



End Function

Sub ccSleep(seconds)
set oShell =3D CreateObject("Wscript.Shell")
cmd =3D "%COMSPEC% /c ping -n " & 1 + seconds & " 127.0.0.1>nul"
oShell.Run cmd,0,1
End Sub

--------------------------------------o------------------------------------=
---
I wish to use the objIE from other functions. But how?


Re: How to set a public object variable? by Anthony

Anthony
Fri Aug 18 07:14:24 CDT 2006


Dim objIE ' <--- Did you not try this like I suggested??


Public Function RunScript()
Set mesajboard = document.getElementById("mesajimiz")

ccSleep(3)
Set objIE = CreateObject("InternetExplorer.Application")
'objIE.visible=true
objIE.Navigate("http://eczane.ssk.gov.tr/eczane/basla")
objIE.ToolBar = 0
objIE.StatusBar = 0
objIE.width="900"
objIE.height="800"
objIE.top="80"
objIE.left="75"

objIE.Visible = True
Do Until objIE.busy
readyx=objIE.ReadyState
ccSleep(1)
readyxcount=readyxcount+1
if readyxcount = 10 then
objExplorer.stop


objIE.close '<!--- are you sure this is what you want to be doing?


end if
mesajboard.innerHTML=readyxcount & " saniye oldu...!"
mesajboard.innerHTML="<font size=1 color=red>Pencerenin tamamen
yüklenmesi bekleniyor...!</font>"
Loop
'MsgBox(objIE.document.readyState)
Set sskdoc=objIE.document
sskdoc.title="EOP kontrolünde SSK islemleri devam ediyor..."
sskdoc.all.tags("INPUT")(1).value="0600100897"
sskdoc.all.tags("INPUT")(2).value="12345678" ' ofcourse wrong pass
sskdoc.all.tags("INPUT")(3).focus()



End Function

Sub ccSleep(seconds)
set oShell = CreateObject("Wscript.Shell")
cmd = "%COMSPEC% /c ping -n " & 1 + seconds & " 127.0.0.1>nul"
oShell.Run cmd,0,1
End Sub

--------------------------------------o-------------------------------------
--
I wish to use the objIE from other functions. But how?



Re: How to set a public object variable? by caglaror

caglaror
Fri Aug 18 08:28:23 CDT 2006

Yes DIM objIE works fine!
But yesterday it didn't.
Thank you very much Anthony.
Have a nice day ;)


Re: How to set a public object variable? by caglaror

caglaror
Fri Aug 18 08:31:23 CDT 2006

Now i am asking further DOM questions.
How can we count that how many key strokes happen in the opened window?
For example if keystrokes count 4 we automatically submit the form from
the opener.
Thanks