Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run Access macro from Excel Spreadsheet
Is it possible to run an Access macro from an Excel spreadsheet?
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run Access macro from Excel Spreadsheet
Karen
You can automate Access like so Sub AutomateAccess() Dim acApp As Access.Application Set acApp = New Access.Application acApp.OpenCurrentDatabase ("C:\db1.mdb") acApp.DoCmd.RunMacro "Test", , "" End Sub This uses early binding so you will need to set a reference to the MS access library in advance via the VBE in Excel (ToolsReferences...) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "Karen" wrote in message ... Is it possible to run an Access macro from an Excel spreadsheet? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run Access macro from Excel Spreadsheet
I can't get this to work --- can you help?
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 "Nick Hodge" wrote: Karen You can automate Access like so Sub AutomateAccess() Dim acApp As Access.Application Set acApp = New Access.Application acApp.OpenCurrentDatabase ("C:\db1.mdb") acApp.DoCmd.RunMacro "Test", , "" End Sub This uses early binding so you will need to set a reference to the MS access library in advance via the VBE in Excel (ToolsReferences...) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "Karen" wrote in message ... Is it possible to run an Access macro from an Excel spreadsheet? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying Data from Access to Excel in a macro | Excel Worksheet Functions | |||
Macro Question - Excel to Access and back again | Excel Discussion (Misc queries) | |||
How to stop Excel remembering/loading macro from previously opened Workbook | Excel Discussion (Misc queries) | |||
create excel spreadsheet on a data access page | Excel Discussion (Misc queries) | |||
Open Access Database under and Excel window using a Macro | Excel Worksheet Functions |