- ©«¤l
- 55
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 81
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- 10
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-5-15
- ³Ì«áµn¿ý
- 2018-11-1
|
¤µ¤Ñ¦³¦b¸Õ¤F¤@Ӥ覡 SendKeys
¥i¥H¦sÀɮפU¨Ó¡A¦ýkey¤Jªº¦W¦r¡A±`±`¶]¤£§¹¥þ¡]¦]¬°n¶]¤Óºô¶¡A¤@Ó¤@Ó¶]¡A¶]¤¦¸¡A¦pªG¤ÏÂФ@ª½«ö¡A¨C¦¸¦sªº¦W¦rn¬Ý¹B®ð¤~·|¥¿½T¤]¡^- Sub ¤U¸üpdf()
- Sheets("¤U¸ü¥Î").Select
-
- Dim xlsName, xlsNameNo, MyName, NewName, SavePath, DDate, URL As String
- xlsName = ActiveWorkbook.Name ''ÀɦW
- xlsNameNo = Mid(xlsName, 1, 4) ''ÀɦW«e4¦r¤¸
- SavePath = ActiveWorkbook.Path ''¸ô®|
- MyName = Application.ActiveWorkbook.FullName ''¸ô®|ÀɦW
- NewName = Left(MyName, Len(MyName) - 5) ''¥h°£°ÆÀɦW
- DDate = Format(Date, "yyyy-mm-dd _ ") ''·í¤é¤é´Á
-
-
- Cells.Clear
- Application.DisplayStatusBar = True
- Application.ScreenUpdating = False
- ''¸³ºÊ«ùªÑ²{ªp1
- Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
- URL = "http://www.fortunengine.com.tw/stock/company/holding.cfm?scode=" & xlsNameNo ''ºô§}
- With ie
- .Visible = False 'True¬°¶}±Òie, False¬°¤£¶}±Òie
- .Navigate URL
-
- Do While .Busy: DoEvents: Loop
- Do While .Busy: DoEvents: Loop
- Do While .Readystate <> 4: DoEvents: Loop
- .ExecWB 6, 2
-
-
- Application.Wait Now + TimeValue("00:00:04")
- Application.SendKeys (DDate & xlsNameNo & "_1")
- ''Application.Wait Now + TimeValue("00:00:01")
- Application.SendKeys "{TAB}", True
- ''Application.Wait Now + TimeValue("00:00:01")
- Application.SendKeys "{TAB}", True
- ''Application.Wait Now + TimeValue("00:00:01")
- Application.SendKeys "{TAB}", True
- ''Application.Wait Now + TimeValue("00:00:01")
- Application.SendKeys "{ENTER}", True
- ''Application.Wait Now + TimeValue("00:00:01")
- Application.SendKeys "{TAB}", True
- Application.SendKeys "{ENTER}", True
-
- End With
-
- Application.StatusBar = False
- ie.Quit
- End Sub
½Æ»s¥N½X |
|