Hello, I am trying to run the following macro from my excel workbook that opens my Microsoft Access database and runs a macro that imports all of my data. It opens access successfully, but then I get the following error:
Run-time error '7866':
Microsoft Access can't open the database because it is missing, or opened exclusively by another user, or it is not an ADP file.
It is located in this file location, and its not opened by anyone (only I have access to it). Any ideas how to fix this, or do you have any thoughts on how I can accomplish this another way?
Run-time error '7866':
Microsoft Access can't open the database because it is missing, or opened exclusively by another user, or it is not an ADP file.
It is located in this file location, and its not opened by anyone (only I have access to it). Any ideas how to fix this, or do you have any thoughts on how I can accomplish this another way?
Code:
Sub accessMacro()
Dim accessApp
Set accessApp = CreateObject("Access.Application")
accessApp.Visible = True
accessApp.OpenCurrentDataBase ("C:\Users\1234\Desktop\Access Database")
accessApp.Run "MasterImport"
End Sub