I have managed to automate a login to an external trading web site using the InternetExplorer.Applicati
on object model via Excel VBA, supplying user name, password and submitting the page. That works. I then select a desired company to trade via a calculated URL (now I'm in) and am presented with a few input boxes, radio buttons and two image buttons at the bottom of the page, [Buy] or [Sell].
When I use a click or submit method on the "Sell" document object, it always starts the "Buy" page (presumabaly the default). Have manually set focus on the web page to [Sell] using tab key and pressed [Enter], but it also reverts to "Buy" page. However a manual left mouse click on [Sell] button works as expected. The form action launches an ActiveServerPage, so the destination URL e.g. http://www.asite.com/next_process.asp
. does'nt really help me.
Most question/answers I have looked at seem to refer to non "Image" input type objects or possibly where only one submit option is available. A few found in other groups imply image buttons maybe posting mouse cordinates and other variables.
So I guess my question/s is does anybody know how I can programatically launch the "Sell" button correctly. I'm still a newbie with regard to the internet object model, so be gentle with me.
HTML Source Extract:
<form action="next_process.asp" name="atrade" ID="atrade" method="post" onsubmit="return ChkFrm(this)">
<input TYPE="hidden" value="123456" name="PortfolioID">
<input TYPE="hidden" value="654321" name="CompanyID">
<input type="image" src="http://asite.com/butt_buy.gif
" value="Buy" name="buy"> <!---onClick="submit()"---
<input type="image" src="http://asite.com/butt_sell.gif
" value="Sell" name="sell"><!---onClick="
My VBA Code Extract:
Dim inp As Object
Set IE = CreateObject("InternetExpl
Set inp = IE.Document.All.Item("sell