Import to excel from accdb access table held in Sharepoint

Molden

Active Member
Joined
Jun 20, 2006
Messages
373
Hi all,

I have an access table that I query through excel. I know have to move the access table to our office 365 sharepoint

It was held on a shared drive which I queried like below

Code:
Sub TestImport()

Dim cn As Object
Dim rs As Object
Dim strSQL As String
Dim strConnection As String
    
    Set cn = CreateObject("ADODB.Connection")
    
    strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
        "Data Source=\\MML.LOCAL\MyDocs\Michael.Smith\Documents\Radio\London UPRNS.accdb"
  
    strSQL = "SELECT Count(*) FROM [London UPRNs];"
    
    cn.Open strConnection
    Set rs = cn.Execute(strSQL)
    
    MsgBox rs.Fields(0) & " rows in MyTable"

    rs.Close
    Set rs = Nothing
    cn.Close
    Set cn = Nothing


End Sub

The URL to where my database will be held is here:

MML.sharepoint.com/sites/team_bi/_layouts/15/guestaccess.aspx?guestaccesstoken=pR2oimbiNon7zdAV8lNAZ9OWrnpk7f0ACJlnxRAKyM8%3D&docid=2_11aab497dad404d70b9240b2561424a40&rev=1&e=bd9e55f437644c4282d695790842bd29

Does anyone know of a way I can change my code to incorporate the databases change of location?

I am using Excel / Access 2016 and the database is saved to office 365 sharepoint.

Thank you in advance
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,215,261
Messages
6,123,931
Members
449,134
Latest member
NickWBA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top