foamRoller Posted March 16, 2010 Share Posted March 16, 2010 I'm trying to run a Access DB macro. Right now I'm getting a syntax error, couldn't find much help in the last couple of hours. In the longterm, I'd like to have a GUI list of all the macros in that particular DB, and allow the user to choose which macro to run.... in this snippet, $db is the .accdb file path. $accApp = ObjGet($db,"") $macro = ObjCreate("Access.AllMacros.Application") $dbs = $accApp.CurrentProject for $macro in $dbs.AllMacros If $macro.IsLoaded = True Then ConsoleWrite(ObjName($macro)) EndIf Next $macro $accApp.CloseCurrentDatabase Link to comment Share on other sites More sharing options...
foamRoller Posted March 16, 2010 Author Share Posted March 16, 2010 #include "boc-library.au3" $accApp = ObjGet($bocdb,"") $macro = ObjCreate("Access.AllMacros.Application") $dbs = $accApp.CurrentProject for $macro in $dbs.AllMacros MsgBox(1, "macro", ObjName($macro)) Next Here's a running version, all of the msgboxes come up as "Access Object" - is there some way to get the actual macro name? Still wondering how to run it too... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now