Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open MS Access Database and running it's maco from Excel
From Excel I want to open a MS Access Database and run a macro within it.
Can anyone please tell me the Excel VBA line code to do this? Thanks KEN |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open MS Access Database and running it's maco from Excel
Sub RunAccessMacro()
Dim appAcc as Access.Application 'Open Access or use it if already running Set appAcc = New Access.Application 'Optional to show or hide Access appAcc.Visible = True 'open desired database appAcc.Open "C:\path\db1.mdb" 'to run Access macro appAcc.DoCmd.RunMacro "MyAccessMacro" 'more optional code 'Close Access appAcc.Quit Set appAcc = Nothing End Sub You will need to set a reference in Excel to the Access object library. Use menu Tools | References, and find "MicrosoftAccess XX.0 Object Library," and check it. Hth, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening an Access Database and running procedure Via Excel VBA | Excel Programming | |||
Can you open Access Database through Excel VBA? | Excel Programming | |||
Open Access Database from Excel | Excel Programming | |||
Open Access Database through Excel | Excel Programming | |||
Can't re-open Access database from Excel VBA | Excel Programming |