- ©«¤l
- 1
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 2
- ÂI¦W
- 0
- §@·~¨t²Î
- W7
- ³nÅ骩¥»
- W7
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2013-8-1
- ³Ì«áµn¿ý
- 2013-8-27
|
[µo°Ý] VBA ºô¶¶×¤J°ÝÃD(·|©w®æªü~)
§Ú»Ýn¤@ӶפJºô¶¦ÜExcel ¥\¯à¤j¬ù¨C30¬í§ó·s¤@¦¸,¦ý¥un¤@¶]QueryTable.Refresh , Excel´N·|Excel©w®æ3¬í¥ª¥k¡A¤£¯à°µ¨ä¥L°Ê§@¡C¦³¨S¦³¤èªk¥i¥H§ïµ½¡C
¦]¬°¶×¤Jºô¶§ó·s¥u¯à³]©w1¤ÀÄÁ¡C©Ò¥H¥u¦n¼g¤U±ªºµ{¦¡(n¨C30¬í§ó·s)
Sub RefreshWeb()
Workbooks("xxx.xls").Worksheets("Sheet1").Range("A1").QueryTable.Refresh BackgroundQuery:=False
DoEvents
Workbooks("xxx.xls").Sheets("Sheet2").Range("B10") = Now + TimeValue("00:00:30") '¤U¦¸§ó·s®É¶¡
Application.OnTime Workbooks("xxx.xls").Sheets("Sheet2").Range("B10"), "ThisWorkbook.RefreshWeb", Schedule:=True
End Sub |
|