Run Marcos in an open DB from Excel

Trigon

Registered User.
Local time
Today, 03:42
Joined
Jun 18, 2014
Messages
10
Hi All

I'm having problems trying to get this to work. When selected by the user I have set our system to push data out into excel, I have then wrote a macro in the spreadsheet that it pushes to ask into to run another macro in access, which then imports and opens forms with it etc.

The problem I'm having is that it keeps opening a new instance of Access instead of using the window the user is already in. How do i make it not do that?

The current code for opening the DB is:

Dim acApp As Object
Set acApp = CreateObject("Access.Application")
acApp.OpenCurrentDatabase ("C:\Access Controls.accdb")
acApp.Run "Import"

Thanks

Chris
 
Set acApp = GetObject("FullPathOfYourDb")
acApp.Run "Import"
 
Thanks, only just got round to looking at this and it worked a treat!! :-)
 

Users who are viewing this thread

Back
Top Bottom