怎么把excel表中的数据自动输入到网页中

 我来答
匿名用户
2016-12-12
展开全部
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim j As Integer
Dim ex As Object
Dim wb As Object
Dim sh As Object
Dim objDoc
Dim endi As Integer
Dim k As Integer
Private i As Integer
Private si As String
Private Sub Form_Load()
WebBrowser1.Width = Screen.Width
WebBrowser1.Height = Screen.Height - 500
i = 1
Set ex = CreateObject("Excel.Application")

Set wb = ex.Workbooks.Open(App.Path & "\1.xls")
Set sh = wb.Sheets(4)
If sh.Cells(1, 1) <> 4 Then
wb.Close True
ex.Quit
Set sh = Nothing
Set wb = Nothing
Set ex = Nothing
Unload Me
End
Else:

Set sh = wb.Sheets(1)
endi = sh.UsedRange.Rows.Count
WebBrowser1.Navigate "http://148.36.20.220:86/"
End If
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If WebBrowser1.LocationURL = "http://148.36.20.220:86/" Then

If i > endi Then

wb.Close True
ex.Quit
Set sh = Nothing
Set wb = Nothing

Set ex = Nothing
Unload Me
End
Else:
WebBrowser1.Document.Forms(0).TextBox1.Value = sh.Cells(i, 1)
WebBrowser1.Document.Forms(0).TextBox2.Value = sh.Cells(i, 2)
j = (Int(Rnd * 10) + 3) * 1000
Sleep j
DoEvents
WebBrowser1.Document.Forms(0).Button1.Click
i = i + 1
End If
End If

If WebBrowser1.LocationURL = "http://148.36.20.220:86/qd.aspx" Then
Dim s As Variant
s = pDisp.Document.documentElement.outerHTML
匿名用户
2016-12-12
展开全部
用按键精灵2014操作。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式