0
VBscript에서 체크 박스 사용에 관한 질문이 있습니다. 데이터가있는 몇 개의 열이있는 큰 Excel 파일이 있습니다. 나는 내 HTML을 vbscript를 사용하여 만들고 체크 박스 이름을 엑셀 파일에서 읽는다. 그곳에 갈 때까지 모든 것이 작동합니다. 확인란을 선택했는지 확인하려고 할 때 'Object required' 'groupnames'오류가 발생합니다. 물론 내가 뭘 잘못했는지 알지만 솔루션을 찾지 못하는 것 같습니다. 나를 도울 수있는 사람이 있습니까?동적 체크 박스 vbscript
<html>
<head>
<title>Check groups</title>
<HTA:APPLICATION
APPLICATIONNAME="Check groups"
ID="Dynamically_check_groups"
VERSION="1.0"/>
</head>
<SCRIPT LANGUAGE="VBScript">
Dim objExcel, objWorkbook, counter
dim groupnames(90)
counter = 0
Sub Window_OnLoad
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open ("D:\Groups.xls")
dim strHTML, intRow
For intRow = 2 to 90
If objExcel.Cells(intRow,4).Value = "sport" Then
if ObjExcel.Cells(intRow,5).Value = "vast" Then
strHTML = strHTML & "<input type="&Chr(34)& "checkbox"&Chr(34)& " name="&Chr(34)& objExcel.Cells(intRow,2) &Chr(34)& ">" &objExcel.Cells(intRow,1) &" <br>"
groupnames(counter) = objExcel.Cells(intRow,2).value
counter = counter + 1
End if
End if
Next
objExcel.Quit
DataArea.InnerHTML = strHTML
End Sub
Sub Check_Groups
Dim i, name
For i = 0 to counter - 1
If groupnames(i).checked Then
Msgbox groupnames(i) & "was checked."
End if
Next
End Sub
</SCRIPT>
<body bgcolor="white">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><Div id="DataArea"></Div></td>
</tr>
<tr>
<td>
<button style="width:200;height:50" name="chkgroups" id="chkgroups" accessKey="C" onClick="vbs:Check_groups">Controleer groepen</button>
</td>
</tr>
</table>
</body>
</html>