#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default vba error

JT,

In Excel, you would use this to run a macro from another workbook:

Application.Run "'Workbook Name.xls'!Macro_Name"

so, and I'm just guessing here, something along the lines of

AppAcc.DoCmd.RunMacro "'" & vName & "'!Import_AR_Data"

You might want to post in an Access group....

HTH,
Bernie
MS Excel MVP


"JT" wrote in message
...
I am opening an Access Database from Excel.....so far no problem.......once I
get the database opened.....I want the macro to run a macro I have stored in
Access.

Here is the code I'm using:

Set AppAcc = New Access.Application
AppAcc.Visible = True
AppAcc.OpenCurrentDatabase vName

AppAcc.DoCmd.RunMacro ("Import_AR_Data")

When the macro gets to this last line of code, I get the following message:

Microsoft Office Access can't find the macro 'Import_AR_Data'

(This Access macro will run several queries in vba from Access)

It is in the database in a module called "Import_ARs"

Any suggestions on what I am doing wrong would be greatly appreciated.
Thanks for all of the help.

--
JT



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
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 12:11 AM.

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"