Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am utilizing macros within some access databases that I have created
through some of the excel macros I also use. I have a formula that works ALMOST. It is supposed to open the database, run the macro, then close the databse. I can get it to do everything but recognize my access databse. Perhaps I am messing up the syntax, any suggestions??? Thanks!!! Sub RunAccessMacro() Dim appAcc As Access.Application Set appAcc = New Access.Application appAcc.Visible = True THIS IS THE LINE THAT IS BUSTED! appAcc.OpenAccessProject "G:\MACHINE DOWN AUDIT DB\QUAD 3 MDA AUTO.mdb" appAcc.DoCmd.RunMacro "MARSHALL" appAcc.Quit Set appAcc = Nothing Everything works fine except that line that I mentioned. I can get things to run smoothly if I already have the databse open, but if I use the code it always bugs out on that line as if it doesn't recognize my database as existing. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will work for you, as long as you have a reference set for
Microsoft Access: Regards, David Miller Sub RunAccessMacro() Dim appAcc As Access.Application Set appAcc = CreateObject("G:\MACHINE DOWN AUDIT DB\QUAD 3 MDA AUTO.mdb") With appAcc .Visible = True .DoCmd.RunMacro "MARSHALL" .Quit End With Set appAcc = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call an Access macro from an Excel macro | Excel Discussion (Misc queries) | |||
Access to Excel Macro | Excel Programming | |||
Use Excel Macro in Access | Excel Programming | |||
Trigger a Macro in MS Access from an Excel Macro? | Excel Programming | |||
Launch Macro in Access via Macro running in Excel??? | Excel Programming |