hi
let's say you want to navigate a web form with lots of checkboxes and radio buttons, where the usual code:
Set F6 = .document.all.Item("A")
F6.Checked = True
just won't cut it, because it is an onclick sort of thing, where even if the above code infills the checkbox, it still doesn't trigger a 'check' (i know, i know, it is hard to believe, but it happens)
since i was not able to get an answer to a better altenative (where you still go directly by name to the item in the form and 'check' thebox by some other means), the only other solution i found that worked was send keys.
a good link for send keys can be found pretty easily. with send key it acts the same as if you were there navigating the web page with a mouse, with the notable caveat that send keys can be inconsistent. one day (TAB 3} (tabbing three times) will put you in check box 'A' where you want to be, and the next day you'll be in check box 'B' whee you don't want. the way to deal with this annoying bugette is to (at least this is what i found) have your macro clear ot the cookie on the users computer that refers to the site in question. in my case i found that if the cookie was not cleared the tab jumped two on me, but when the cookie was cleared it always starts in the right place. since i'll have no idea whether on not a user will hve cookies cleared or not cleared, the best thing to do is clear the cookie first.
for my tutorial on how to do this:
Click Here
So setting up a send keys navigation routine was not the hard part - it was dealing with the cookie that was. now you can use send keys with a clear cookie and have a greatly improved chance the box you want checked will be checked.
but if there is another way besides this:
Set F6 = .document.all.Item("A")
F6.Checked = True
to 'check' a box on a web form that refuses to do so with the above code, i am all ears.
tx
let's say you want to navigate a web form with lots of checkboxes and radio buttons, where the usual code:
Set F6 = .document.all.Item("A")
F6.Checked = True
just won't cut it, because it is an onclick sort of thing, where even if the above code infills the checkbox, it still doesn't trigger a 'check' (i know, i know, it is hard to believe, but it happens)
since i was not able to get an answer to a better altenative (where you still go directly by name to the item in the form and 'check' thebox by some other means), the only other solution i found that worked was send keys.
a good link for send keys can be found pretty easily. with send key it acts the same as if you were there navigating the web page with a mouse, with the notable caveat that send keys can be inconsistent. one day (TAB 3} (tabbing three times) will put you in check box 'A' where you want to be, and the next day you'll be in check box 'B' whee you don't want. the way to deal with this annoying bugette is to (at least this is what i found) have your macro clear ot the cookie on the users computer that refers to the site in question. in my case i found that if the cookie was not cleared the tab jumped two on me, but when the cookie was cleared it always starts in the right place. since i'll have no idea whether on not a user will hve cookies cleared or not cleared, the best thing to do is clear the cookie first.
for my tutorial on how to do this:
Click Here
So setting up a send keys navigation routine was not the hard part - it was dealing with the cookie that was. now you can use send keys with a clear cookie and have a greatly improved chance the box you want checked will be checked.
but if there is another way besides this:
Set F6 = .document.all.Item("A")
F6.Checked = True
to 'check' a box on a web form that refuses to do so with the above code, i am all ears.
tx