one drive file path syntax error

TCM1770

Board Regular
Joined
Feb 6, 2005
Messages
121
Office Version
  1. 365
i am using a one drive and the error i am getting when i try to run my access connection is .... the below noted file name is not a valid path. Please make sure that the path name is spelled correctly and that you are connected to the server in which the file resides.

I get the error but for the life of me i am not understanding the onedrive syntax of the file location. I am hoping it is just a quick fix because I loved this method of saving data from excel to access...

MY VBA CODE:

'excel file that you want to export data to the Access database.

Dim mData As String
mData = ActiveWorkbook.Name 'this shows the excel workbook that is active

Dim mrow As Integer ' counting of rows in the sheet to Be exported

'CREATE THE CONNECTION...

Dim mConnection As ADODB.Connection
Set mConnection = New ADODB.Connection

'"CREATE THE LINK" to the access database master data file using your connection created


Dim mtransit_file As String
mtransit_file = "provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=C:\USERS\(myname)OneDrive-personal(xxxxxx@comcast.net)\INSURANCE\QuoteS1.accdb"
mConnection.Open mtransit_file

Thank you in advance for your assistance...
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Thanks for the views - I figured it out it has to do with the one drive location.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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