View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ed from AZ Ed from AZ is offline
external usenet poster
 
Posts: 120
Default Access wab page with excel VBA

When trying to get a handle on objects on a web page, I've used the
Mouseover DOM Inspector at
http://slayeroffice.com/tools/modi/v2.0/modi_help.html
It's a bookmarklet that allows you to mouse over any object on a web
page - frame, button, link, whatever - and will show you all the
available attributes. You can often get the name, the ID number, the
container frame, and other information.

Ed

On Dec 11, 5:55 am, Incidental wrote:
Hi Madiya

If you view the source code for the web page you should be able to
find the ID to the button, the HTML below is from an intranet site
that holds a basic login form that requires a user name and password,
then a button click to start the login with the data given or to reset
the form.

<form name="login" method="POST" action="/Basic/login.asp"
<pUsername:
<input name="txtUserName" type="text" id="txtUserName" size="10"
maxlength="10"
</p
<pPassword:
<input name="txtPassword" type="password" id="txtPassword" size="10"
maxlength="10"
</p
<p
<input type="reset" name="Reset" value="Reset"
<input name="Submit" type="submit" id="Submit" value="Submit"

in this case if i wanted to automatically control this page i would
set an object for the things i need, one for the Username and password
and one for the button, i can set the object to reference an item on
the web page by setting the object to the ID of the webpage
control ...

Set MyObject = ie.document.all.Item("txtPassword")

then i can use that control

MyObject.value="drowssap"

as for the buttons i don't need to set them to an object but i do
however need to call them by the correct ID

ie.document.all.Item("Submit").click 'Where Submit is the button ID
taken from the HTML code.

however you need to remember to clean up after yourself if you are
creating and setting objects, when you are done with them set them
back to nothing. I normally do this at the end of the function or sub
so i always know where to look to see if they have been reset...

Set NameCbo = Nothing
Set PsWord = Nothing
Set Ref = Nothing
Set InstLnk = Nothing
Set Lnk = Nothing

I hope this clears things up for a you a bit but if not let me know
and i shall see what i can come up with.

Steve