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

[µo°Ý] VBA±±¨îIE¿é¤J­È

[µo°Ý] VBA±±¨îIE¿é¤J­È

½Ð°ÝVBA¯«¤H:
­n¦p¦ó±±¨îIEªº­È¦bVBAª½±µ¿é¤J´N¦n?
¥H¤U¬O§Ú¼Ò¥éªºµ{¦¡¡A¦a°Ï¿é¤J: 104 ¡A
°õ¦æ¨ìSet what = .document.getElementByName("onchage")
´N¥X²{¿ù»~°T®§¡A¥i¬O¤£ª¾¹D«ç»ò§ï¡A½Ð°Ý¦³¤j¤j¥i¥H¨ó§U¶Ü??

Sub Ex_ºô­¶¤¸¯À_3()

Dim E As Object, what As Object

Set objIE = CreateObject("InternetExplorer.application")
URL = "http://amis.afa.gov.tw/v-htm/v102.htm"

myjobtype = InputBox("¿é¤J¦a°Ï¥N¸¹:")

With objIE
    .Visible = True
    .Navigate URL
    Do While .Busy Or .readyState <> 4: DoEvents: Loop
   
    Set what = .document.getElementByName("onchage")
    what.Item(0).Value = myjobtype
   
    .document.getElementByName("B1").Click        '·j´MÁä
   
   
   
                With .document  'ºô­¶ªº¤å¥ó
                  '*** ³o¬qµ{¦¡½X¥i¬d¬Ý³oºô­¶ªº¤¸¯À¤º®e
                    On Error Resume Next
                    For Each E In .all
                        i = i + 1
                        Cells(i, "a") = E.tagname   '±±¨î¶µ¼Ð°Oªº¦WºÙ
                        Cells(i, "b") = E.ID        '±±¨î¶µ¼Ð°OªºID (±©¤@ªº)
                        Cells(i, "c") = E.Name      '±±¨î¶µ¼Ð°Oªº©R¦W
                        Cells(i, "d") = E.Value     '±±¨î¶µ¼Ð°Oªº­È
                        Cells(i, "e") = E.innertext '±±¨î¶µ¼Ð°Oªº¤å¦r
                        Cells(i, "f") = E.Type      '±±¨î¶µ¼Ð°OªºÃþ«¬
                        Cells(i, "g") = E.href      '±±¨î¶µ¼Ð°Oªººô§}
                    Next
                  '****************************************
                End With
                '.QUIT
    End With

End Sub

ªþ¤WÀɮפº®e¡A½Ð¤j¤jÀ°¦£¤U!!

¹A²£«~»ù®æ.rar (30.55 KB)

TOP

¤Ó·PÁÂGBKEE¤j¤j¤F!! ¥i¥H¨Ï¥Î¡C
¥t¥~½Ð°Ý¥H¤UÅܼƦb­þ¸Ì¦³»¡©ú¸ê®Æ?
xTable(i).Rows.Length - 1
xTable(i).Rows(r).Cells.Length - 1
Cells(k + r, c + IIf(i = 0, 1 + 1 * c, 1)) = xTable(i).Rows(r).Cells(c).innerText

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD