ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running A Access Macro From Excel (https://www.excelbanter.com/excel-programming/306634-running-access-macro-excel.html)

Frank

Running A Access Macro From Excel
 
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?

papou[_10_]

Running A Access Macro From Excel
 
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


"Frank" a écrit dans le message de
...
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?




Frank

Running A Access Macro From Excel
 
ActiveX component can't create object? is there another way of doing this.
Frank

"papou" wrote:

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


"Frank" a écrit dans le message de
...
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?






All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com