• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Executing Access Macro in Visual Basic 6.0

I have code where I dont reference access in my project itself.  Can I execute a macro using the folliowing code?  I dont see the DoCmd options under my properties.  I would rather just use something similar to what I have and not reference access.  Here is what I use now:

        Set wsAccessWs = DBEngine.Workspaces(0)
        Set dbAccessDb = wsAccessWs.OpenDatabase(App.Path & gsDBName, False, False)

the dbAccessDb has .execute and then a query name.  But I dont see anything for executing a macro.  Thanks all.
0
sbornstein2
Asked:
sbornstein2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
You might be able to use Shell to start Access, then use the /x macroname command line switch to execute that specific macro
http://support.microsoft.com/default.aspx?scid=kb;en-us;209207
0
 
aikimarkCommented:
You can use automation to instantiate an MSAccess object.  That will then allow you to invoke the .DoCMD method of the object to run the macro.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now