EXCEL VBA 我调用OLE CREATEOBJECT开启ie 依序抓取资料但是 执行到k 为 39 或 50 就无法开启ie for k = 1 to 51
Set myIe = CreateObject("InternetExplorer.Application") '开启ie
'' sURL= "http://justweb.jihsun.com.tw/z/zh/zhc/zhc_23025_1.asp.htm" ''sample 23025_1 ~ 23025_51
sURL= "http://just.jsun.com.tw/z/zh/zhc/zhc_23025_" + str(k) +".asp.htm"
''sample 23025_1 ~ 23025_51
myIe.Navigate sURL
myIe.Visible = true
myIe.Quit
Set myIe = Nothing
next
Set myIe = CreateObject("InternetExplorer.Application") '开启ie
'' sURL= "http://justweb.jihsun.com.tw/z/zh/zhc/zhc_23025_1.asp.htm" ''sample 23025_1 ~ 23025_51
sURL= "http://just.jsun.com.tw/z/zh/zhc/zhc_23025_" + str(k) +".asp.htm"
''sample 23025_1 ~ 23025_51
myIe.Navigate sURL
myIe.Visible = true
myIe.Quit
Set myIe = Nothing
next
可把createobject(xxx),跟set xxx = nothing这两句放到循环外面。