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

Hello
I have added a button to my spreadsheet that I would like to Run an Access
Macro.
When I execute my code I get "Method Or Data Member Missing". I have turned
on the MS Access object Reference
This is my code

Private Sub CommandButton1_Click()

Dim appAcc As Access.Application

Set appAcc = New Access.Application
appAcc.Visible = True
appAcc.Open "G:\Mypath\Myfile.mdb"
appAcc.RunMacro "MyMcaro"
appAcc.Quit
Set appAcc = Nothing

End Sub

What am I doing wrong?
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Run Acess Macro

I think you need to do this:
appAcc.DoCmd.RunMacro "MyMacro"
--
- K Dales


"Sandy" wrote:

Hello
I have added a button to my spreadsheet that I would like to Run an Access
Macro.
When I execute my code I get "Method Or Data Member Missing". I have turned
on the MS Access object Reference
This is my code

Private Sub CommandButton1_Click()

Dim appAcc As Access.Application

Set appAcc = New Access.Application
appAcc.Visible = True
appAcc.Open "G:\Mypath\Myfile.mdb"
appAcc.RunMacro "MyMcaro"
appAcc.Quit
Set appAcc = Nothing

End Sub

What am I doing wrong?
Thanks!

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
Import from Acess problems with SQL language toby131 Excel Discussion (Misc queries) 1 November 14th 09 01:38 AM
Can Excel be linked to MS Acess? Madhart Excel Discussion (Misc queries) 2 August 19th 08 11:46 AM
Linking Acess with Excel Perrygarl Excel Discussion (Misc queries) 1 November 15th 06 01:51 PM
Acess x Excell Vanessa Simmonds Excel Discussion (Misc queries) 7 May 5th 06 02:38 PM
what is a syntax error in microsoft acess Syntax Error Charts and Charting in Excel 0 July 28th 05 05:56 AM


All times are GMT +1. The time now is 10:37 PM.

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

About Us

"It's about Microsoft Excel"