首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请各位帮小弟我看看这些代码。万分感谢了

2012-03-02 
请各位帮我看看这些代码。万分感谢了。大家好!本人不懂vba,对代码也不是太熟悉。我这有几个代码希望大家帮忙

请各位帮我看看这些代码。万分感谢了。
大家好!本人不懂vba,对代码也不是太熟悉。我这有几个代码希望大家帮忙把难点句子注释一下,另外代码里有整个的语句还希望帮忙说明一下这整个语句表示的是什么内容。谢谢了!代码如下:
  代码一:
Sub test()
With CreateObject("InternetExplorer.Application")
  .Visible = True
  .navigate "http://www.sephora.cn/html/imagesNew/btn_goGrey.gif”
  DoEvents
  While.busy
  DoEvents
  Wend
  With .Document
  .GetElementById("username").Value = "hyangyang0613"
  .GetElementById("password").Value = "hyy379509"
  .GetElementById("loginsubmit").Click
  End With
End With
End Sub
 代码二:
  Dim strSch As String
Dim ImgButton, schText
  strSch = ThisWorkbook.Sheets("sheet1").Cells(1, 1) 
 
  For Each schText In WebBrowser1.Document.All
  If LCase(schText.tagname) = "input" Then
  If LCase(schText.Type) = "text" Then
  If schText.Name = "searchText" Then
  schText.Value = strSch 'text
  End If
  End If
  End If
  Next
  'form1.searchText
  For Each ImgButton In WebBrowser1.Document.All
  If LCase(ImgButton.tagname) = "input" Then
  If LCase(ImgButton.Type) = "image" Then
  'If ImgButton.src = " http://www.xxxxxxxx" Then
  ImgButton.Click '点击
  'End If
  End If
  End If
  Next
 代码三:
Dim shResult
  Dim fs, a
  Set fs = CreateObject("Scripting.FileSystemObject")
  Set a = fs.CreateTextFile("G:\sh.txt", True) 
  For Each shResult In WebBrowser1.Document.getElementsByTagName("table") '
  a.WriteLine (shResult.InnerText)
  a.Close
Next
  整个的语句:比如说在代码二里从第一个if到第一个end if结束这是一个语句集,那说明这个语句表示的是什么?
我这么说希望大家能看明白。呵呵!!又要麻烦各位了。我也可以学习学习。呵呵!!循环语句也帮忙说明一下吧。

[解决办法]

探讨

引用:
获取页面文本框,searchText的值,并把值写入到EXCEL的第一个单元格


谢谢你了。这就没有了阿!!我是把单元格的值写到网页里面啦。。呵呵

[解决办法]
怪了 咋没了呢 呵呵

热点排行