Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Run Access Macro with Excel Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Run Access Macro with Excel Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Access to Excel Macro Josh E Excel Programming 1 October 7th 05 07:34 PM
Use Excel Macro in Access bharat Excel Programming 1 June 22nd 05 01:17 AM
Trigger a Macro in MS Access from an Excel Macro? DonRetd Excel Programming 13 March 30th 05 09:52 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"