Sub
Conn as new adbdb.connection
Dim str as string
Str=application.getopenfilename(,,,,false)
Connect.open"provide=Microsoft.ace.oledb.12.0;date sourse=______;extend properties=""excel 12.0;hdr=yes"""
Conn.close
End sub
想抓取檔案資料 ,下劃線處的檔案路徑我想用str回傳的檔案路徑,因為資料檔案每次下載名字不是固定的,想請問下有沒有辦法可以實作,求教,謝謝。
uj5u.com熱心網友回復:
給你改了一下,看能不能用:
Dim Conn as new adbdb.connection
Dim strPath as string
strPath=application.getopenfilename(,,,,false)
Conn.open"provide=Microsoft.ace.oledb.12.0;data source=" & strPath & ";extend properties=""excel 12.0;hdr=yes"""
' 這里操作Conn/RS;
Conn.close
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/15166.html
標籤:VBA
