- ©«¤l
- 161
- ¥DÃD
- 26
- ºëµØ
- 0
- ¿n¤À
- 187
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2011-1-2
- ³Ì«áµn¿ý
- 2022-2-16
|
½Ð°Ý call ªº°ÝÃD
½Ð°Ý¤W¦¡¥i°õ¦æ§ï¬°¤U±ªºcall´N¤£¯à¡AÁÂÁÂ
¥²¶·¬O±`¦¡¹Bºâ¦¡
--------------------------------------------------
¤Þ¥Î [µo°Ý] ¨D§U~¤@Ó¥ÎVBA±qºô¶¨ú±o·Qn¸ê®Æªº¼gªk~
'Private Sub CommandButton1_Click()
' ' Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zck/zck_6257.asp.htm"
' Const url As String = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Ficxxx\&stockid=2002&name1=D4&index1=12" ' ¥¿½Tªº
'
' Cells.Clear
'
' Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
'
' With ie
' .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
' .Navigate url
' Do While .ReadyState <> 4 'µ¥«Ýºô¶¶}±Ò
' DoEvents
' Loop
' .ExecWB 17, 2 'Select All
' .ExecWB 12, 2 'Copy selection
' Range("A1").Activate
' ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
' False, NoHTMLFormatting:=True
' End With
'
' Columns("A:B").Delete ' ±N¶×¤J®É A¡BB ¨âÄæ²¾°£¡A 쥻 C:I ªºÄæ¦ì¥þ³¡¥ª¾a¡A ¦¨¬° A:I
' ie.Quit
' MsgBox "¸ê®Æ½Æ»sµ²§ô" ' Â÷¶}«eÅã¥Ü¤@¤pµøµ¡´£¿ô¡A«ö¥¦«á§Yµ²§ô¡C
'End Sub
Private Sub test2(ByVal ss As String)
' Const url As String = "http://jsjustweb.jihsun.com.tw/z/zc/zck/zck_6257.asp.htm"
Const url As String = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Ficxxx\&stockid=" & ss & "&name1=D4&index1=12" ' ¥¿½Tªº
Cells.Clear
Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
With ie
.Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
.Navigate url
Do While .ReadyState <> 4 'µ¥«Ýºô¶¶}±Ò
DoEvents
Loop
.ExecWB 17, 2 'Select All
.ExecWB 12, 2 'Copy selection
Range("A1").Activate
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
End With
Columns("A:B").Delete ' ±N¶×¤J®É A¡BB ¨âÄæ²¾°£¡A 쥻 C:I ªºÄæ¦ì¥þ³¡¥ª¾a¡A ¦¨¬° A:I
ie.Quit
MsgBox "¸ê®Æ½Æ»sµ²§ô" ' Â÷¶}«eÅã¥Ü¤@¤pµøµ¡´£¿ô¡A«ö¥¦«á§Yµ²§ô¡C
End Sub
Sub test2_1()
Call test2("2002")
End Sub |
-
-
¬¡¶Ã¯1.rar
(28.62 KB)
|