¸ß°Ý .WebBrowser1ªº´XÓ°ÝÃD
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
¸ß°Ý .WebBrowser1ªº´XÓ°ÝÃD
¥Ø«e½s¼g §Q¥Îuserform ¬d¸ßexcel ¦WºÙ ªºgooglemap
(¤£n°Ý§Ú¬°Ô£¤£ª½±µ¥Î §Úªº¦a¹Ï¤Ï¬d¬OÓ§|... ¥Î¸g½n«×¤Ï¬d·|§ä¤£¨ì¦aÂI)
¹J¨ì´XÓ°ÝÃD...
1.maps.google ÅܼƤ@ª½¦b§ïÅÜ n¦p¦ó§JªA§ì¨úÃöÁäID°Ñ¼Æ?
©T©wªºID >> searchbox-searchbutton [·j´Mªº¨ºÓID] ¸ò searchboxinput [¿é¤J¬d¸ßªº¤å¦r®ØID]
ÅܰʪºID >> sb_cb50 [¨ú®ø·j´Mªº¨ºÓ«ö¶sID] << ³oӮɤ£®É´N§ïÅÜ¡An«çÅý¥L©T©w¡H
2.¦pªG¤£²z·|ÅÜ°ÊID ª½±µ³]©w §ó°Ê«á ª½±µ·j´M¡A±N·|³y¦¨ ·j´M¨ì²Ä¤Gµ§¸ê®Æ®É¡A½w¦sÁÙ°±¯d¦b²Ä¤@µ§¡C
¨Ò¦pcombobox1 ¤º¦³ ´ºÂI1 ¸ò ´ºÂI2
¦pªG³]©w·j´M ´ºÂI1 µM«á«ö¤U·j´MÁä®É WebBrowser1 ·|Åã¥Ü ´ºÂI1ªº©w¦ì
¦ý¦pªG±µµÛ·j´M´ºÂI2 µM«á«ö¤U·j´MÁä®É WebBrowser1 ¤´µMÅã¥Ü ´ºÂI1ªº©w¦ì
Set tet(0) = .TextBox1
Set tet(1) = .TextBox2
Set cmb(0) = .ComboBox1
Set cmb(1) = .ComboBox2
Set cmb(2) = .ComboBox3
With .WebBrowser1
With .Document
.GetElementById("searchboxinput").Value = cmb(2).Text '¦b·j´Mtextbox·j´M ¦WºÙ
.GetElementById("searchbox-searchbutton").Click 'ÂIÀ»·j´M©ñ¤jÃ誺«ö¶s
.GetElementById("gs_lc50").Click '¨ú®ø·j´M
.GetElementById("searchboxinput").Value = cmb(2).Text '¦b·j´Mtextbox·j´M ¦WºÙ
.GetElementById("searchbox-searchbutton").Click 'ÂIÀ»·j´M©ñ¤jÃ誺«ö¶s
'¥¿±`¨Ó»¡ ¨ú®ø·j´M«á «·s¿é¤J·sªº¦WºÙ¡AÀ³¸Ó¬On·j´M·sªº¦WºÙ¡A¦ý¥Lªº¼È¦s¨Ì¬Oªº
Do
DoEvents
Loop
End With |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|
- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
³t«×¤Ó§Ö¡AWebBrowser¨S¤ÏÀ³¹L¨Ó¡C
WebBrowser¬O²§¨Bªº¥[¸üªº¡A³Ì¦n¬O¦b¨C¤@Ó©R¥O¤§¦Zµ¥«ÝWebBrowser§¹¥þ¥[¸ü§¹¦¨¦AÄ~Äò¤U¤@Ó©R¥O¡C |
|
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥hþ¡H
|
|
|
|
|
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
³t«×¤Ó§Ö¡AWebBrowser¨S¤ÏÀ³¹L¨Ó¡C
WebBrowser¬O²§¨Bªº¥[¸üªº¡A³Ì¦n¬O¦b¨C¤@Ó©R¥O¤§¦Zµ¥«ÝWebBrowser§¹¥þ ...
Joforn µoªí©ó 2020-11-26 22:39
·PÁ¦^ÂÐ~
¥Ø«e§ï¦¨¤U¦Cµ{¦¡½X~ ·|±Ò°Ê·j´Mªº¥\¯à(©w¦ì) ¡A¦ý¨ÌÂÂ¥u·|Ū¨ú²Ä¤@¶µ...QQ
¼W¥[¶µ¥Ø>> «öÁä¼ÒÀÀ »P®É¶¡°±¹y- With .WebBrowser1
-
- With .Document
-
- '.GetElementById("gs_taif50").Click
-
- .GetElementById("searchboxinput").Value = cmb(2).Text
- .GetElementById("searchbox-searchbutton").Click
-
- .GetElementById("searchboxinput").Value = cmb(2).Text
- Application.Wait Now + TimeValue("0:00:05")
- .GetElementById("gs_lc50").Click
- Application.OnKey "+^{a}" '¼ÒÀÀ«öÁä ctrl + a
- Application.OnKey "{del}" '¼ÒÀÀ«öÁä del
- .GetElementById("searchboxinput").Value = cmb(2).Text
- Application.OnKey "+^{ENTER}" '¼ÒÀÀ«öÁäctrl + enter
- .GetElementById("searchbox-searchbutton").Click
- Do
- DoEvents
- Loop
-
- End With
- End With
½Æ»s¥N½X |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|
- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
¦^´_ 3# mark15jill
§Aªº¥N½X¤¤¦³¤@¥y¡G²Ä¤@¦¸°õ¦æ¦Zµ{¦¡±N¶i¤J¥Ã¤[¦º´`Àô¡A«Øij¥h±¼¡C |
|
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥hþ¡H
|
|
|
|
|
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
¥»©«³Ì«á¥Ñ mark15jill ©ó 2020-11-27 10:31 ½s¿è
¦^´_ mark15jill
§Aªº¥N½X¤¤¦³¤@¥y¡G²Ä¤@¦¸°õ¦æ¦Zµ{¦¡±N¶i¤J¥Ã¤[¦º´`Àô¡A«Øij¥h±¼¡C
Joforn µoªí©ó 2020-11-27 10:16
¥Ø«e§ï¦¨¤U¦Ccode ~
¦ý·|³y¦¨...
¸ê®Æ1 << Ū¨ú¨SÂIÀ»
¸ê®Æ2 << ¦³®ÉŪ¨ú¨ì¸ê®Æ1 ¦³®É¨S¤ÏÀ³
¸ê®Æ3 << ¦³®ÉŪ¨ú¨ì¸ê®Æ1 ¦³®ÉŪ¨ú¨ì¸ê®Æ2 ¦³®É¨S¤ÏÀ³
¦pªG®É¶¡©µ¿ðŪ¨ú³]¸m¹L¤j~ ¤S·|³y¦¨¥d¥dQQ
With .WebBrowser1
With .Document
'.GetElementById("gs_taif50").Click
.GetElementById("searchboxinput").Value = cmb(2).Text
.GetElementById("searchboxinput").Select
Application.OnKey "+^{ENTER}"
.GetElementById("searchbox-searchbutton").Click
'.GetElementById("searchbox-searchbutton").Click
.GetElementById("searchboxinput").Select
Application.OnKey "+^{a}"
Application.OnKey "+^{del}"
Application.OnKey "+^{ENTER}"
Application.Wait (Now + TimeValue("0:00:3"))
cmb(2).Copy
.GetElementById("searchboxinput").Select
Application.OnKey "+^{v}"
'.GetElementById("searchboxinput").Value = cmb(2).Text
Application.OnKey "+^{ENTER}"
.GetElementById("searchbox-searchbutton").Click
Application.Wait (Now + TimeValue("0:00:3"))
End With
End With
·Pı®Ú¥»¬O§âVBA·í«öÁäºëÆF¦b¼g... |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|
- ©«¤l
- 109
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 114
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7 Win10
- ³nÅ骩¥»
- Office 2019 WPS
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ²`¦`
- µù¥U®É¶¡
- 2013-2-2
- ³Ì«áµn¿ý
- 2024-11-6
|
¥»©«³Ì«á¥Ñ Joforn ©ó 2020-11-27 11:47 ½s¿è
¦^´_ 5# mark15jill
«Ü¤[³£¤£¥ÎWebBrowser±±¥ó¤F¡C¥u¯à¸ò§A¤jP»¡¤U³B²z¬yµ{¡C
¦bµo°e©R¥O¦Z¡A¤@¯ë¥Î- IsBusy=True '³oÓ¬O¥þ§½Åܶq¡A¥ÑWebBrowserªº¥[¸ü§¹¦¨¨Æ¥ó¥h±N¨äȧïÅÜ¡C
- Times=0
- Do While IsBusy And (Times<100) 'ÀË´úTimes¬O§_¤p¤_100¡A¤j¤_100§PÂ_¬°µ{§Ç¥X°ÝÃD¤F¡A¥[¸ü®É¶¡¹Lªø¡A±j¦æ¤¤¤îµ{¦¡¹B¦æ¡C100¦¸´`Àô»P¦Z±ªºSleep 200²Õ¦X¡Aªí¥Ü³Ìªøµ¥«Ý20¬í(Sleep°Ñ¼Æ¥H²@¬í¬°³æ¦ì)¡C
- Sleep 200 '³oÓ¬OAPI¨ç¼Æ¡A¨Ï¥Î«en¥ýÁn©ú¡C¥[¤J³o±ø»y¥y¬O¬°¤FÄÀ©ñCPU±±¨îÅv¡A¨S¦³³o±ø¡AVBAªºCPU¨Ï¥Î²v¤@ª½¥e99%
- DoEvents 'ÄÀ©ñµ{§Ç±±¨îÅv¡A¨¾¤îWebBrower¥X°ÝÃD¦ZµLªk°h¥X¡A¤]¬O¬°¤FÅýWebBrower¦³¬ÛÀ³ªºCPU¹B¦æÅv¥hÄ~Äò¥[¸ü¶±¡C
- Times=Times + 1
- Loop
½Æ»s¥N½X µM¦ZÁÙn¦A¤Þ¥ÎWebBrower±±¥óªºDocumentComplete- Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
- IsBusy = False
- End Sub
½Æ»s¥N½X ¤W±¨â²Õ¥N½X¬Ûµ²¦X¡A¨º¤\´N¥i¥H§¹¦¨¤@Óµ¥«Ý¶±¥[¸ü§¹¦¨¦Z¡Aµ{¦¡¤~Ä~Äò°õ¦æ¦ZÄò¥N½X¹Lµ{¡C
¦ý¬O¡Anª`·N¡G¦bWebBrower¥[¸ü¶±¶}©l¦Z¡A¦}¤£¤@©w¥u¿E¬¡¤@¦¸DocumentComplete¡A©Ò¥HÁÙn¦bWebBrowser1ªºDocumentComplete¨Æ¥ó³B²z¹Lµ{¤¤¶i¦æ¤@©wªº§PÂ_¨Ó¬O§_¬O¯u¥¿ªº³Ì¦Z¤@¦¸¶±¥[¸ü§¹¦¨¨Æ¥ó¡C¥i¥H¹ï¤ñURL¬O§_¬O·í«e¶±ªºURL¨Ó§PÂ_¡G- Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
- If IsBusy Then IsBusy = URL<>DocumentURL 'ª`·N¡A³o¨½ªºDocumentURL»Ýn§A¦Û¤v®Ú¾Ú§A·í«eªº¶±¥hÀò¨ú©Î¬O³]¸m¡C
- End Sub
½Æ»s¥N½X ³Ì¦Z¬O§A¥i¯à»Ýn¥Î¨ìªº¨ç¼Æ©MÅܶqÁn©ú¡G- #If VBA7 Then
- Private Declare PtrSafe Sub Sleep Lib "Kernel32.dll" (ByVal dwMilliseconds As Long)
- #Else
- Private Declare Sub Sleep Lib "Kernel32.dll" (ByVal dwMilliseconds As Long)
- #End If
- Private IsBusy As Boolean
½Æ»s¥N½X |
|
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥hþ¡H
|
|
|
|
|
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
¦^´_ mark15jill
«Ü¤[³£¤£¥ÎWebBrowser±±¥ó¤F¡C¥u¯à¸ò§A¤jP»¡¤U³B²z¬yµ{¡C
¦bµo°e©R¥O¦Z¡A¤@¯ë¥ÎµM¦ZÁÙ ...
Joforn µoªí©ó 2020-11-27 11:41
¨SÃö«Y... §Ú§ï¥Îvb.net¼g¬Ý¬Ý~ ·PÁ |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|
¡@¼ÊºÙ: ÀH·ÄÆ¿ºªº¦Ð¤ò ¡@ÀY»Î: [±s¥Î]¼ç¤ô¸¥
°ª¤¤¥Í
- ©«¤l
- 852
- ¥DÃD
- 79
- ºëµØ
- 0
- ¿n¤À
- 918
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7 , XP
- ³nÅ骩¥»
- Office 2007, Office 2003,Office 2010,YoZo Office
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¦t©z
- µù¥U®É¶¡
- 2011-4-8
- ³Ì«áµn¿ý
- 2024-2-21
|
¦^´_ mark15jill
«Ü¤[³£¤£¥ÎWebBrowser±±¥ó¤F¡C¥u¯à¸ò§A¤jP»¡¤U³B²z¬yµ{¡C
¦bµo°e©R¥O¦Z¡A¤@¯ë¥ÎµM¦ZÁÙ ...
Joforn µoªí©ó 2020-11-27 11:41
«á¨Óµo²{..... ¦³Ó§ó§Öªº¤èªk¸Ñ¨M...
cmb(0).text >> combobox.text >> n¬d¸ßªºª«¥ó
.Navigate ("about:blank")
.Navigate ("https://www.google.com.tw/maps/search/" & cmb(0).Text)
¤£ºÞ¥Lªº·j´M¤¸¥ó°Ñ¼Æ¡A±j¨î¼ÒÀÀ¤â°Ê·j´Mªº¤è¦¡...
¥u¬O·s²£¥Í´XÓ°ÝÃD...
1¡B¥Î¤W±ªº¤èªk¡AÁöµM·|¦Û°ÊÅܤƻP©w¦ì¡A¥i¬Oµe±¦]¬°vba»Pie¤¸¥ó¤Á´«Åª¨ú¡A»Ýnµ¥ªº®É¶¡§ó¤[¡C
2¡Bgooglemap §âid ¸ò span ÁôÂñ¼... ¨Sªkª½±µ¬Ý "¤À¨É" ªºID ¸òÃþ§O |
|
¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~
¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk
¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM
|
|
|
|
|