|
2#
楼主 |
发表于 2012-6-6 15:24:12
|
只看该作者
本帖最后由 fengdishudu444 于 2012-6-6 15:26 编辑
回复 1# fengdishudu444
Dim MainContainer,Document
Set MainContainer = CreateObject("InternetExplorer.Application")
MainContainer.Navigate "about:blank"
MainContainer.Visible = True
Set Window = MainContainer.Document.parentWindow
Set Document = Window.document
Dim TextBox, Command1
Document.body.appendChild(document.createTextNode("请选择需要运行的页签名字,点击确定: "))
For Each i In xlsobj.ACTIVEWORKBOOK.WORKSHEETS
Set TextBox= Document.CreateElement("<input type='radio' name='TextBox' value='"&i.name&"'>")
Set obj1 = Document.body.appendChild(TextBox)
Document.body.appendChild(document.createTextNode(i.name))
Next
Set Command1 = Document.CreateElement("<input type='button' id='Command' value='确定'>")
Set Command1.OnClick = GetRef("Command1_Click")
'上句中,GetRef调用自过程,但是Command1_Click过程有参数,此处要怎么办?
'Command1_Click 包含参数,如下
Function Command1_Click(obj1,TextBox,Command1,Window)
TextBoxValue=TextBox.Value
If obj1.checked = True Then
Window.alert "Command1被单击了!" & VbCrLf & "文本框中的内容是: " & TextBoxValue
Else
Window.alert "您没有进行选择,请选择后在点击确定按钮"
End If
End Function
Set Command1.OnClick = GetRef("Command1_Click")此句怎么传递参数? |
|