Sub 驗證碼識別() ActiveSheet.Shapes.SelectAll Selection.Delete Cells.Clear Columns("b").NumberFormatLocal = "@" For i = 1 To 10 yzm = Format(Int(Rnd() * 10000), "0000") yzm1 = "" For j = 1 To 4 a = Val(Mid(yzm, j, 1)) - j If a < 0 Then a = a + 10 yzm1 = yzm1 & a Next j Cells(i, 1).RowHeight = 15 Cells(i, 1).ColumnWidth = 5.25 ML = Cells(i, 1).Left MT = Cells(i, 1).Top MW = Cells(i, 1).Width MH = Cells(i, 1).Height Cells(i, 1).Select ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select Selection.ShapeRange.Fill.UserPicture "http://www.gdltax.gov.cn/wssw/checkcode/checkcode" & yzm & ".png" Selection.ShapeRange.Line.Visible = False Cells(i, 2) = yzm1 Next iEnd Sub
Private Sub Command1_Click() '新型農村合作醫學管理平台_使用者登陸 On Error Resume Next With CreateObject("internetexplorer.application") .Visible = True .Navigate "http://125.46.57.85/hnxnh/login/login.aspx" Do Until .ReadyState = 4 DoEvents Loop .document.All("TB_userid").Value = "使用者名稱" .document.All("TB_userpwd").Value = "密 碼" .document.All("Tb_yzm").Value = .document.getelementbyid("checkCode").innerText '驗證碼 .document.All("ImageButton1").Click End WithEnd Sub