html将excel数据自动导入到网页,如何把excel表中的数据自动输入到网页中
怎么把excel表中的數(shù)據(jù)自動(dòng)輸入到網(wǎng)頁(yè)中
因要給員工網(wǎng)上投工傷保險(xiǎn),員工資料在excel表中,現(xiàn)在在網(wǎng)上投保險(xiǎn)時(shí)只能一筆筆的復(fù)雜粘貼到網(wǎng)頁(yè)中,有沒有辦法能直接把excel表中的資料自動(dòng)輸入到網(wǎng)頁(yè)中的對(duì)應(yīng)的表格中呢?請(qǐng)知道的朋友說(shuō)下方法啊,非常感謝!
------最佳解決方案--------------------
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
總結(jié)
以上是生活随笔為你收集整理的html将excel数据自动导入到网页,如何把excel表中的数据自动输入到网页中的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 基于OpenCV与MFC的人脸识别
- 下一篇: 697小说源码PC端+手机端+采集工具(