ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] VBA ¤Wºôªº¦^À³°ÝÃD¥H¤ÎVBA ¾Þ±±ºô­¶ªºªì¾Ç¤è¦¡

[µo°Ý] VBA ¤Wºôªº¦^À³°ÝÃD¥H¤ÎVBA ¾Þ±±ºô­¶ªºªì¾Ç¤è¦¡

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-2-19 08:46 ½s¿è

¤Wºô¦³¬d¸ß¨ìºô­¶ªº¬ÛÃö¸ê°T,¦P®É¤]¬Ý¤F¥»ª©ªº¸ê°T±oª¾¥H¤U°T®§¥i¥H°»´ú¥X¬O§_ÁÙ¦b¹B§@¤¤
  1. While .busy Or .readyState <> 4
  2. Application.Wait (Now + TimeValue("0:00:01"))'DoEvents¦³®É·|ÁÙ¨SÂ৹´NÄ~Äò°õ¦æ¤F(¥i¯à®t0.0´X¬í)
  3. Wend
½Æ»s¥N½X
²{¦b¹J¨ìªº°ÝÃD¬O:µ{¦¡¶}±Òºô­¶«á¡A¨Ã«D¥Îºô­¶¤¸¯À¶i¦æ¾Þ§@¡A¦Ó¬O¥Î·Æ¹«ÂIÀ»ªº¤è¦¡¨Ó±±¨î
¦b³oºØ±¡ªp¤U¡A¤W­zªºµ{¦¡½XµLªk°»´ú¸Óºô­¶¬O§_¦b¹B§@¤¤¡A½Ð°Ý¥Î·Æ¹«ÂIÀ»ªº¤è¦¡¨Ó±±¨îºô­¶¡A¦³¿ìªk°»´ú¥X¬O§_ÁÙ¦b¹B§@¤¤©O?

§Ú¥Ø«e¥u¦³·Q¨ì¤@­Ó¤è¦¡¬O¡A·Æ¹«ÂIÀ»¤§«á¡A¦A§Q¥Î.Refresh¡AÅýºô­¶­«·s§ó·s¡A¦¹®É¤W­zªºµ{¦¡½X´N¯àµo´§¥\¥Î±oª¾¬O§_ÁÙ¦b¹B§@¤¤

¬°¦ó­n±oª¾ºô­¶¬O§_ÁÙ¦b¹B§@?¦]¬°ºô­¶¹B§@§¹²¦¤§«áÁÙ¦³«áÄòªº°Ê§@¡A­Y¤£¯à±oª¾¬O§_¹B§@§¹²¦¡A¥u¯à©T©w¥Î¬í¼Æ(¦ý¦³³s½u³t«×ªº°ÝÃD)¥i¯à·|¾É­P¿ù»~

¥H¤Î¦U¦ì¤j¤j¬O§_¥i¥H±ÀÂˤ@¤U¡A¾Ç²ß§Q¥ÎVBA¤Wºô¾Þ±±ºô­¶ªºªì¾Ç¤è¦¡
¨Ò¦p¤U¤èµ{¦¡½X:(¥i¥H¦Û°Ê¤WºôGOOGLE¨Ã¿é¤JÃöÁä¦r¡AµM«á¦Û°Ê¬d¸ß)
  1. With CreateObject("InternetExplorer.application")
  2. .Visible = True
  3. .navigate ("http://www.google.com/")
  4. While .busy Or .readyState <> 4
  5. Application.Wait (Now + TimeValue("0:00:01"))
  6. Wend

  7. .document.all.q.Value = "keyword"
  8. While .busy Or .readyState <> 4
  9. Application.Wait (Now + TimeValue("0:00:01"))
  10. Wend
  11. .document.all.btnG.Click
  12. While .busy Or .readyState <> 4
  13. Application.Wait (Now + TimeValue("0:00:01"))
  14. Wend
½Æ»s¥N½X
¥H¤Wªº¥\¯à³£¬O¤Wºô¬d¸ß¨Óªº¡A¥i¬O¦b¨ä¥Lªººô¯¸­n¦p¦ó§ä¨ì¥H¤U³o¨â­Ó¤¸¯À¡A¸Ó¦p¦ó¶}©l¾Ç²ß©O?
.document.all.q.Value =>¿é¤J¬d¸ßªºÃöÁä¦r(¤£¾å±o¸Ó¦p¦ó§ä¨ì³o­Ó¤¸¯À)
.document.all.btnG.Click=>¬d¸ßªº«ö¶s(¤£¾å±o¸Ó¦p¦ó§ä¨ì³o­Ó¤¸¯À)

ÁÙ¬O¦³¤j¤j±ÀÂ˦p¦ó¶}©l¾Ç²ßºô­¶¤¸¯À©O?
PKKO

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-2-18 13:24 ½s¿è

¦^´_ 1# PKKO
½Ð°Ý¦³¿ìªk°»´ú¥X¬O§_ÁÙ¦b¹B§@¤¤©O?

ºÝ¬Ýºô­¶ªº¤º®e¦Ó²§ http://forum.twbts.com/thread-16257-1-1.html

   
.document.all.q.Value =>¿é¤J¬d¸ßªºÃöÁä¦r(¤£¾å±o¸Ó¦p¦ó§ä¨ì³o­Ó¤¸¯À)
.document.all.btnG.Click=>¬d¸ßªº«ö¶s(¤£¾å±o¸Ó¦p¦ó§ä¨ì³o­Ó¤¸¯À)

http://forum.twbts.com/thread-13669-1-1.html
¤¸¯À¦³Name(???) ´N¥i®M¨ì .document.all.???
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
·PÁ¶Wª©¤j¤j¡A¤w¸g¹ê»ÚÀ³¥Î¤F±zªººô­¶¤¸¯Àªºµ{¦¡½X

¦³¥H¤U¦¬Ã¬
¤@¡B­ì¨Ó¤£»Ý­n¬Ýºô­¶­ì©l½X´N¥i¥H±o¨ìºô­¶¤¸¯À¡A¤§«e¬Ý¤F¦n¤[¡A³£¥u¯à½M²q¨ì¤@¨Ç
¤G¡B¨Ï¥Î¸Óµ{¦¡½X¤§«á§Y¥i¤F¸Ñºô­¶¤¸¯Àªº°ò¥»¬[ºc¡A­ì¨Ó¦p¦¹¬Ù¨Æ¡A¯uªº¤Ó·PÁ¶Wª©¤j¤j

¦ý¤´¦³¤@¨Ç°ÝÃD·Q¸ß°Ý¶Wª©¤j¤j
¤@¡B§Ú¥Ø«e¥uª¾¹D¥i¥H¬d¸ß.GetElementsByTagName("INPUT")¡B.GetElementsByTagName("SELECT")¡B.GetElementsByTagName("BUTTON")
        §Ú­n¦p¦ó±oª¾©Ò¦³¡B.GetElementsByTagName ªº¤¸¯À¦³­þ¨Ç¥i¥H¬d¸ß?
¤G¡B§Ú¥Ø«e¬d¸ß¨ì¦³¨Ç¤¸¯À¨Ã¨S¦³´£¨ÑNAMEªº³¡¤À¡A¨º­n¦p¦ó±±¨î¸Óºô­¶©O(ÁÙ¦³¨ä¥L¤èªk¶Ü)?
¤T¡B¦³¨Çºô­¶¦³¤£¦P¤À­¶(Ãþ¦üUSERFORMªºPAGE1,PAGE2³o¼Ë)¡A³oºØ¤Á´«¤À­¶ªº¤¸¯À­n¦p¦ó§ä¨ì©O?
PKKO

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-2-19 08:45 ½s¿è

¦^´_ 3# PKKO
http://forum.twbts.com/tag.php?name=ºô­¶¤¸¯À
¬ÛÃöªº°ÝÃD ¦b [¤j½L¾ú¥v¸ê®Æ¬d¸ß]
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE
·PÁ¶Wª©¤j¤j,¤w¸g·|¨Ï¥Î,·í¨S¦³NAMEªº®É­Ô­n¦p¦ó¾Þ§@¸Ó¤¸¯À
  1. For Each E In .GetElementsByTagName("BUTTON")
  2.                 If E.Type = "submit" And E.innertext = "µn¿ý" Then
  3.                     E.Click
  4.                     Exit For
  5.                 End If
  6.             Next
½Æ»s¥N½X
¥i¥H¨Ï¥Î¤W­zªºµ{¦¡½X¡A§P©wTYPE©Î¬O¥ô·NªºÄݩʬ°«ü©w¦WºÙ®É
«hE.CLICK ©Î¬O E.VALUE=xx
¤w¸g¹êÅç¹L¤W­z¨âºØ³£¥i¦æ
·PÁ¶Wª©¤j¤j¡AÄ~Äò¹êÅç¨ä¥L¤À­¶©Î¬Oªí³æªº³¡¤À
«D±`·PÁÂ!
PKKO

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/2/23 10:49): http://tw.dictionary.search.yahoo.com/search?p=true&tab=definition&fr2=dict °Q½×ª©¤W¦³·j¯Áªº¥\¯à,½Ð§ä§ä¬Ý

¦^´_ 4# GBKEE

©êºp¡AÁÙ·Q½Ð°Ý¤@¤U
°£¤F±±¨îºô­¶¤¸¯À¤§¥~
¨Ò¦p:http://tw.dictionary.search.yahoo.com/search?p=true&tab=definition&fr2=dict
³o­Óyahoo©_¼¯ªºÂ½Ä¶
­n¦p¦ó±N¤U¤èªºÂ½Ä¶¸ê®Æ¤U¸ü¦^¨Ó¦Üexcel¤À­¶¤º©O?
PKKO

TOP

        ÀR«ä¦Û¦b : ¯à¥I¥X·R¤ß´N¬OºÖ¡A¯à®ø°£·Ð´o´N¬O¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD