VB写自动填写网页程序的问题 50
用VB写了一个自动提交网页的程序对<INPUTonclick=addRowToTable();class=editBottomButtontype=buttonvalue...
用VB写了一个自动提交网页的程序
对<INPUT onclick=addRowToTable(); class=editBottomButton type=button value=增加>,应该输入哪一个字段能让按钮点击的动作发生?
附部分原代码:
Private Sub Command4_Click()Dim SheetID As IntegerDim firstRowID As IntegerDim TotalBitID As IntegerDim i As IntegerDim j As IntegerDim keyID(7) As ObjectDim rowID(7) As ObjectSheetID = Int(sheet.Text) '设定表编号,即Sheet的编号。Set ExcelApp = CreateObject("Excel.Application") 'Set ExcelBook = ExcelApp.Workbooks.Open(App.Path + "\导入模板.XLS") '路径Set ExcelSheet = ExcelBook.Worksheets(SheetID) 'firstRowID = Int(firstRow.Text) '读取起始行TotalBitID = Int(TotalBit.Text) '要读取的行数
For i = 0 To (TotalBitID - 1)For j = 0 To 7If key(j).Text <> "" Then Set rowID(j) = ExcelSheet.Range(row(j).ToolTipText & firstRowID) Set keyID(j) = WebBrowser1.Document.All(key(j).Text) keyID(j).Value = rowID(j).ValueEnd IfSet rowID(j) = NothingSet keyID(j) = NothingNext jWebBrowser1.Document.All(submit.Text).ClickfirstRowID = firstRowID + 1 '循还Next iExcelApp.QuitSet ExcelSheet = NothingSet ExcelBook = NothingSet ExcelApp = Nothing
End Sub
程序截图: 展开
对<INPUT onclick=addRowToTable(); class=editBottomButton type=button value=增加>,应该输入哪一个字段能让按钮点击的动作发生?
附部分原代码:
Private Sub Command4_Click()Dim SheetID As IntegerDim firstRowID As IntegerDim TotalBitID As IntegerDim i As IntegerDim j As IntegerDim keyID(7) As ObjectDim rowID(7) As ObjectSheetID = Int(sheet.Text) '设定表编号,即Sheet的编号。Set ExcelApp = CreateObject("Excel.Application") 'Set ExcelBook = ExcelApp.Workbooks.Open(App.Path + "\导入模板.XLS") '路径Set ExcelSheet = ExcelBook.Worksheets(SheetID) 'firstRowID = Int(firstRow.Text) '读取起始行TotalBitID = Int(TotalBit.Text) '要读取的行数
For i = 0 To (TotalBitID - 1)For j = 0 To 7If key(j).Text <> "" Then Set rowID(j) = ExcelSheet.Range(row(j).ToolTipText & firstRowID) Set keyID(j) = WebBrowser1.Document.All(key(j).Text) keyID(j).Value = rowID(j).ValueEnd IfSet rowID(j) = NothingSet keyID(j) = NothingNext jWebBrowser1.Document.All(submit.Text).ClickfirstRowID = firstRowID + 1 '循还Next iExcelApp.QuitSet ExcelSheet = NothingSet ExcelBook = NothingSet ExcelApp = Nothing
End Sub
程序截图: 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询