使用下面的代码可以重写css数据,但不能读取。 我怎样才能阅读css-data?
我一直在努力解决这个问题2天了。任何帮助都将得到真正的赞赏。
Dim IE As Object
Dim divElem As HTMLDivElement
Sub GetCSSData()
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://en.wikipedia.org/wiki/Main_Page"
IE.Visible = True
While IE.readyState <> 4
DoEvents
Wend
Set divElem = IE.Document.getElementById("p-logo")
ActiveSheet.Cells(1, 1).Value = divElem.Style.Top 'Cell is empty
divElem.Style.Top = "100px"
ActiveSheet.Cells(2, 1).Value = divElem.Style.Top 'Cell get 100px
End Sub