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

[µo°Ý] Â^¨ú¤WÂdªÑ»ù¦æ±¡~¹J¨ì«D¥æ©ö¤é§Y¸õ¥X¿ù»~°T®§!

¦^´_ 9# cudui
³o¥i¦Û¤v¸Õ¸Õ¬Ý ¤£¦æ¦A»¡

TOP

''¤WÂd­ÓªÑ¾ú¥v¸ê®Æ
   With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.otc.org.tw/ch/st ...
chen_cook µoªí©ó 2012-4-20 07:14


ÁÂÁ¤j¤j¤F,
§Ú¦A¸Õ¸ÕCSV & Html°õ¦æ¦³¤°»ò®t§O~~
·s¤â¤W¸ô

TOP

¦^´_ 7# GBKEE
  1. If Err.Number <> 0 Then Err.Clear: MsgBox "¸ê®Æ¬d¸ß¥¢±Ñ"
½Æ»s¥N½X
½Ð°ÝG¤j, ¸Ó¦æ¥i¥H§ï¦¨¤U¦C¼gªk¶Ü?
If Err.Number <> 0 Then
GOTO ABC123
END IF
....

ABC123:
Next J ....



ÁÂÁÂ!!
·s¤â¤W¸ô

TOP

http://www.otc.org.tw/ch/stock/aftertrading/otc_quotes_no1430/SQUOTE_AL_1010419.CSV
§A¤S§ì¨ì¨S¦³¸ê®Æªººô­¶¤F....


³oºô­¶§Ú½T©w¬O¥i¥Hrun±o¨ì¸ê®Æ¤U¨Óªº~~
¥æ©ö¤é¨S¦³°ÝÃD,¦ý¬O«D¥æ©ö®ÉµLdata®É¤~·|¥X¿ù~


   §Aªº°ÝÃD«ÜÅ¢²Î...¨Sªk§¹¾ã¦^µª......¦pªG¬O¤@­Ó¥i¥¿½Trunªºvba,¤]­n¥ý»¡©ú§Aªº­ÓÅÞ¿è...
    ³Ì²³æªº¤èªk¬O±N¾ã¦~ªº¥æ©ö¤é´Á­p¹º®³¨ì,¤ñ¹ï±ý§ì¨úªº¤é´Á¥Ø¼Ð,¨Ì§P©wÅܧóreportªºhtml.....


¥æ©ö¤é¨C¦~³£¤£¦P,©Ò¥H¥Î¤ñ¹ïªº¤èªk,·|¤ñ¸û³Â·Ð~
§Úªº°ÝÃD¥i¯àÁÙ¤£°÷©ú½T,
§Æ±æ±o¨ìªº¸Ñµª¬O:¦p¦ó¦b¸Óvba¤º,²K¥[§PÂ_¦¡---§PÂ_­Y¹J¨ì"¬d¸ß¥¢±Ñ"©Î"¬dµL¸ê®Æ"®É,¥i¥H goto NEXT one,Ä~Äò¥¼§¹ªº¬d¸ß,¦Ó«D¸õ¥X....
(¦]¬°¤£ª¾¹D·í htmlµL¸ê®Æ¥iÂ^¨ú®É,·|¦^õX¤°»ò¼Ëªº°T¸¹...)
·s¤â¤W¸ô

TOP

¦^´_ 2# cudui
  1. On Error Resume Next
  2.     With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.otc.org.tw/ch/stock/aftertrading/otc_quotes_no1430/SQUOTE_AL_" & myear & mmon & nowday & ".html" _
  3.         , Destination:=ActiveCell.Offset(2, 0))
  4.         .WebSelectionType = xlEntirePage
  5.         .WebFormatting = xlWebFormattingNone
  6.         .WebPreFormattedTextToColumns = True
  7.         .WebConsecutiveDelimitersAsOne = True
  8.         .WebSingleBlockTextImport = False
  9.         .WebDisableDateRecognition = False
  10.         .WebDisableRedirections = False
  11.         .Refresh BackgroundQuery:=False
  12.         If Err.Number <> 0 Then Err.Clear: MsgBox "¸ê®Æ¬d¸ß¥¢±Ñ"
  13.     End With
½Æ»s¥N½X

TOP

''¤WÂd­ÓªÑ¾ú¥v¸ê®Æ
   With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.otc.org.tw/ch/st ...
chen_cook µoªí©ó 2012-4-20 07:14



    ³o¬O¿ù»~ªº¸ê®Æ

TOP

''¤WÂd­ÓªÑ¾ú¥v¸ê®Æ
   With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.otc.org.tw/ch/stock/aftertrading/otc_quotes_no1430/SQUOTE_AL_" & myear & mmon & nowday & ".CSV" _
        , Destination:=ActiveCell.Offset(2, 0))
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = True
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = False
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "1,2,3"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
   
   
    Range("a3:a2200").Select
       Selection.TextToColumns Destination:=Range("b4"), DataType:=xlDelimited, _
       TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
       Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
         Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), _
         Array(14, 1), Array(15, 1)), TrailingMinusNumbers:=True
    Range("a4:a2200").Delete
    Rows("4:4").Select
    Selection.Delete Shift:=xlUp
    Columns("A:O").Select
    Range("a1").Activate
    Selection.ColumnWidth = 8
   
End Sub

¸Õ¸Õ¬Ý§a

TOP

http://www.otc.org.tw/ch/stock/aftertrading/otc_quotes_no1430/SQUOTE_AL_1010419.CSV
§A¤S§ì¨ì¨S¦³¸ê®Æªººô­¶¤F....

TOP

¦^´_ 1# cudui


    ½Ð°Ý¸Ó«ç»ò­×§ï¥H¤Uªºvba¥N½X,
¨Ï¨ä¥i¥H¥ý§P©w·í¤é¦³¨S¦³¥æ©ö¸ê®Æ,¦A¶i¦æ¸ê®ÆÂ^¨ú/©Î¸õ¦Ü¤U¤@­Ó¥æ©ö¤é ???

   §Aªº°ÝÃD«ÜÅ¢²Î...¨Sªk§¹¾ã¦^µª......¦pªG¬O¤@­Ó¥i¥¿½Trunªºvba,¤]­n¥ý»¡©ú§Aªº­ÓÅÞ¿è...

    ³Ì²³æªº¤èªk¬O±N¾ã¦~ªº¥æ©ö¤é´Á­p¹º®³¨ì,¤ñ¹ï±ý§ì¨úªº¤é´Á¥Ø¼Ð,¨Ì§P©wÅܧóreportªºhtml.....

TOP

¦^´_ 1# cudui


¿ù»~°T®§³£¦b~µ{¦¡run¨ì .refresh BackgroundQuery:=False ®É¥X²{error(°õ¦æ¶¥¬q¿ù»~1004)
·s¤â¤W¸ô

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD