stefanteulon
asked on
Call a javascript function in vb
This is very urgent!!
Is it possible to call a javascript function from vb, currently I've got:
Function BrowseIt()
Dim ieBrowser As Object
Dim oForm
Set ieBrowser = CreateObject("InternetExpl orer.Appli cation")
ieBrowser.navigate "http://www.intexmirror.com/intexnet/"
ieBrowser.Visible = True
Set oForm = ieBrowser.Document.Forms(" WebTraderf rm")
oForm.all("shemp").Value = "teul****"
oForm.submit
Set oForm = ieBrowser.Document.Forms(" WebTraderF rm")
oForm.all("USER_DEAL_NAME" ).Value = "MIDOC001"
__________________________ __________ __________ __________ __________ __________ __________ __________ __________ ____
'NOT WORKING BELOW THIS LINE!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!! !!!!!!!!!! !!!!!!!!!
ieBrowser.Document.parentW indow.exec Script "USER_DEAL_NAME.value = SelectDealGO();", "javascript"
ieBrowser.Visible = False
Set ieBrowser = Nothing
End Function
I constantly get a run-time error number of '-2147352319 (80020101)' Could not complete the operation due to error 80020101
the source code from the web page is:
"<TD CLASS=D ALIGN=left> <A onMouseOver=ShowPopup(this ,'Action', 'SelectCus ip') onMouseOut=HidePopup()><FO NT SIZE=1><INPUT TYPE=radio NAME=DEAL_OR_SEARCH VALUE=deal CHECKED> CUSIP, ISIN, CINS, or DEAL ID</FONT></A> <TD CLASS=D ROWSPAN=2> <FONT SIZE=1> <INPUT TYPE=text NAME=USER_DEAL_NAME VALUE='SOLSTICE' SIZE=30 onFocus=this.select() onKeyPress=SelectDealKeyPr ess(event) > </FONT> <TD CLASS=D ROWSPAN=2> <A HREF="Javascript:SelectDea lGo()"><FO NT SIZE=1> <IMG BORDER=0 SRC=/images/webtrader/Gree nGoBtn.gif ALT='Get deal info'> </FONT></A>
"
Any help would so greatly appreciated!!!
Is it possible to call a javascript function from vb, currently I've got:
Function BrowseIt()
Dim ieBrowser As Object
Dim oForm
Set ieBrowser = CreateObject("InternetExpl
ieBrowser.navigate "http://www.intexmirror.com/intexnet/"
ieBrowser.Visible = True
Set oForm = ieBrowser.Document.Forms("
oForm.all("shemp").Value = "teul****"
oForm.submit
Set oForm = ieBrowser.Document.Forms("
oForm.all("USER_DEAL_NAME"
__________________________
'NOT WORKING BELOW THIS LINE!!!!!!!!!!!!!!!!!!!!!!
ieBrowser.Document.parentW
ieBrowser.Visible = False
Set ieBrowser = Nothing
End Function
I constantly get a run-time error number of '-2147352319 (80020101)' Could not complete the operation due to error 80020101
the source code from the web page is:
"<TD CLASS=D ALIGN=left> <A onMouseOver=ShowPopup(this
"
Any help would so greatly appreciated!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i don't think you can do in your way
however, if you use ms internet controls (shdocvw.dll), you may be able to trap some event
ie
NavigateComplete2, DocumentComplete etc
however, if you use ms internet controls (shdocvw.dll), you may be able to trap some event
ie
NavigateComplete2, DocumentComplete etc
ASKER
This was sort of where i was looking down but i don;t think you code can sit there and think, i.e. wait until documentComplete. The way i was going to solve would be to create a loop that only moves on when DocumentComplete = true.
Is this feasible?
Is this feasible?
you can create a loop to check the readystate too
ASKER
just done it mate, cheers for your help, I simple put:
Do Until WebBrowser.Busy = false
loop
works a treat
cheer
Do Until WebBrowser.Busy = false
loop
works a treat
cheer
ASKER
Call ieBrowser.Document.frames.
Works a treat.
Just one more questin if you don't mind, do you know what property I can use to tell if the page has finished loading? I.e I run a script, then make the code wait using a validifying loop until the page is flagged to say that it is finished loading, then the code continues with somehting else on the loaded page?
cheers