No, this code will never work:
strHTML = strHTML & "objElement.onchange=" & Chr(34) & "VBScript:MsgBox Me.SelectedIndex" & Chr(34) & vbCRLF
You can only use the Me
like that if you code it inline, as in:
<select name="whatever" onchange="vbscript: MsgBox(Me.SelectedIndex)">
in that way in VBScript.
But what I am mystified about
: If you can't *FIND* the <select> then how are you managing to use
to attach the even to the un-findable <select>????
If you can find it to do the attachment, why can't you use the same code during the event handling?
EDIT: Never mind. I get it. objElement is happening as you are *CREATING* the <select>. DOH on me. Sorry.