Running A Access Macro From Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please can someone help? I have a Macro in Access But I need to run it from
within Excel using VBA code.
Is this possible?
 
Hello Frank
Yes this is possible using OLE:
Requires a reference to Microsoft Access n.0 Object Library where n is
version number of Access
Dim ObjAcc As Access.Application
Set ObjAcc = CreateObject("Access.Application")
ObjAcc.OpenCurrentDatabase "D:\Mes
Documents\Pascal\Office\Access\DonneesNew.mdb"
ObjAcc.UserControl = True
AppActivate "Microsoft Access"
ObjAcc.Run ("MacroName")
Set ObjAcc = Nothing

HTH
Cordially
Pascal
 
ActiveX component can't create object? is there another way of doing this.
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top