0
我試圖使用excel vba刷新access db中的sharepoint鏈接表。 心中已經創造了在Excel VBA中通過excel刷新訪問數據庫中的sharepoint鏈接表vba
On Error GoTo ExceptionHandle
Dim cn As ADODB.Connection, rs As ADODB.Recordset
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=C:\sample.accdb;"
' open a recordset
Set rs = New ADODB.Recordset
訪問數據庫的連接,但我如何使用方法CurrentDb.TableDefs(「表名」)。RefreshLink。我如何使用cn
指定currentdb。
一個選項會將代碼寫入Access,然後從Excel中調用它。看到這裏:http://stackoverflow.com/questions/9472652/calling-access-sub-from-excel –