Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub RunAccessMacro()
Dim appAcc As Access.Application 'Opens Access or gets reference to app already running Set appAcc = New Access.Application 'Optional to show or hide Access appAcc.Visible = True appAcc.OpenAccessProject "P:\Analytic\Heather\Individual\IndividualTurnover Report.mdb" appAcc.DoCmd.RunMacro "Macro1: Get Data" appAcc.DoCmd.RunMacro "Macro2: Create Report" 'Close Access appAcc.Quit 'This will close Access, even w/o the 'Quit' command Set appAcc = Nothing End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See comment inline.
"Blondie" wrote in message ... Sub RunAccessMacro() Dim appAcc As Access.Application 'Opens Access or gets reference to app already running Set appAcc = New Access.Application 'Optional to show or hide Access appAcc.Visible = True appAcc.OpenAccessProject "P:\Analytic\Heather\Individual\IndividualTurnover Report.mdb" Application.OpenAccessProject() is used for opening Access project file (*.adp), not *.mdb. You should use appAcc.OpenCurrentDatabase "P:\Analytic\Heather\Individual\IndividualTurnover Report.mdb" appAcc.DoCmd.RunMacro "Macro1: Get Data" appAcc.DoCmd.RunMacro "Macro2: Create Report" 'Close Access appAcc.Quit 'This will close Access, even w/o the 'Quit' command Set appAcc = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
What the F@#% is wrong with this code?? | Excel Programming | |||
What is wrong with this code? | Excel Programming | |||
What's wrong with this code??? | Excel Programming | |||
What's wrong with the code,pls hv a look | Excel Programming |