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

¨DQueryTables ­n¦p¦ó滙¤J¨ä¥Lªº excel ÀÉ®×

¨DQueryTables ­n¦p¦ó滙¤J¨ä¥Lªº excel ÀÉ®×

³o¬O¿ý¸m¥¨¶°©Ò²£¥Íªºµ{¦¡½X, ¦ý¤£¤F¸Ñ³o­Ó»yªk, ¦³°ª¤â¥i¥H¸Ñµª¶Ü
  ³o­Ó¥¨¶°¥i¥H¦A²¤Æ¶Ü  

  With ActiveSheet.QueryTables.Add(Connection:=Array( _
        "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=I:\VBA.xls;Mode=Share Deny Write;Extended Prop" _
        , _
        "erties=""HDR=YES;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=3" _
        , _
        "5;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Datab" _
        , _
        "ase Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=F" _
        , "alse;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"), _
        Destination:=Range("A2"))
        .CommandType = xlCmdTable
        .CommandText = Array("Status$")
        .Name = "VBA_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .PreserveColumnInfo = True
        .SourceDataFile = "I:\VBA.xls"
        .Refresh BackgroundQuery:=False
    End With

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD