- ©«¤l
- 3
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 10
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-13
- ³Ì«áµn¿ý
- 2015-3-30
|
[µo°Ý] Excel VBAŪ¨ú¨ä¥LExcelÀɮתº°ÝÃD
¤j®a¦n¡A¤p§Ì¥Ø«e¬Oªì±µÄ²VBAªº¾Ç²ßªÌ¡A
³Ìªñ¬°¤F¤u§@¤Wªº»Ý¨D¡A¼g¤FÓŪ¨ú¨ä¥LExcelÀɮתºVBAµ{¦¡
¥Dn¥Øªº¬On±q¥Ø«eªº¤u§@ªíŪ¨úBook3.xls¤ºªº¸ê®Æ¨Ã§e²{¡A
µ{¦¡½X¦p¤U¡G
Sub Test()- Sub Test()
- Dim cn As ADODB.Connection
- Dim rsT As ADODB.Recordset
- Set cn = New ADODB.Connection
- With cn
- .Provider = "Microsoft.Jet.OLEDB.4.0"
- .ConnectionString = "Data Source=C:\Users\Eddie\Desktop\Book3.xls;" & _
- "Extended Properties=Excel 8.0;"
- .Open
- End With
- Set rsT = cn.OpenSchema(adSchemaTables, Array(Empty, Empty, "book1", Empty))
- Range("A1").CopyFromRecordset rsT
- rsT.Close
- cn.Close
- Set rsT = Nothing
- Set cn = Nothing
- End Sub
½Æ»s¥N½X ¦bµ{¦¡°õ¦æ¤W¨S¦³¥X²{Error, ¦ý¬O°ÝÃD¦b©óµLªk¦b¥Ø«eªº¤u§@ªí¤WÅã¥Ü¡A
½Ð°Ý¦U¦ì«e½ú¬Oþ¸Ì¥X²{°ÝÃD©O?
ÁÂÁÂ |
|