LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default How do you fire HTML events using Excel to automate IE?

Hi,

I'm trying to automate a web form-filling process by using Excel to control
IE, similar to the way discussed in the most helpful "Web Browser Question"
thread found he

http://www.microsoft.com/office/comm...xp=&sloc=en-us

The website has 2 combo/dropdown boxes called "Name" and the 2nd called
"Type". In all cases, I would like to set the "Type" to 'Other'.

The problem is that the value of Type equating to 'Other' changes depending
on the value of Name. So for example, if Name.value="A" then the 'Other'
option for Type is set to "X". But if Name.value="B" then to choose 'Other'
we need Type.value="Y".

Having looked through the HTML source code, I have identified that this
assignment is done in a Name_onchange() event, fired when the *selection* of
Name is changed. Therefore, changing the value of Name in code using

IE.Document.All.Item("Name").Value="A"

unfortunately does not cause this event to fire, meaning that the 'Other'
option for Type will never have been set to "X", hence the line

IE.Document.All.Item("Type").Value="X"

will fail to set Type to 'Other'.


****
So my question is: What line(s) of code do I need to have IE recognise that
the Name value has changed, therefore firing the the Name_onchange() event?
Would I need something like a Name.Select="A" (don't know the syntax so I
can't get this working...) to simulate a manual selection, or something else?
I would really appreciate any ideas and help!! Thanks very much in advance
everyone!


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop excel from processing HTML? IE paste raw html. nick Excel Discussion (Misc queries) 2 April 21st 23 05:12 PM
Can I use VBA to automate the recording of daily events? Will Excel Discussion (Misc queries) 0 October 4th 06 05:55 AM
Data Val list Excel 97 fire macro rgarber50 Excel Discussion (Misc queries) 4 October 9th 05 05:19 PM
Excel 2003 won't fire Excel 2000 Macro peparke Excel Programming 1 October 1st 04 05:48 PM
Which Events Fire When I Delete A Row, and How Many Times? Alan Excel Programming 2 September 21st 04 10:50 PM


All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"