PDA

View Full Version : Execute Access Module within Excel



taporctv
06-21-2007, 08:11 AM
I created an Access object within Excel but I dont know how to use this object to execute a procedure I wrote in Access. How would I go about doing this?

qff
06-21-2007, 01:17 PM
Hi

First add a reference to Microsoft Access 11 Object library

Sub RunAccessProc()

Dim myaccess As Object

Set myaccess = CreateObject("Access.Application")

myaccess.OpenCurrentDatabase ("C:\mydatabase.mdb")

myaccess.Run "Procedure" 'name of procedure

myaccess.Quit

Set myaccess = Nothing

End Sub


regards
qff