I can run MS Access macros (which then run a MS Access VBA function) with Python as discussed here. However, Access macros seem not to be able to use parameters.
Is there any possibility to run a Access VBA sub or function directly from Python and pass parameters to it? I tried application.run.
VBA Code:
Public Function doNothing()
MsgBox "Test"
End Function
Access Macro3: Runs exactly this Function
Python:
import win32api
from win32com.client import Dispatch
objAccess = Dispatch("Access.Application")
objAccess.Visible = True
objAccess.OpenCurrentDatabase(destinationName)
#Working with macro: (but no parameters possible)
objAccess.DoCmd.RunMacro('Macro3')
#Not working: direct function call
#objAccess.Run('doNothing')
#Also not working:
#objDB = objAccess.CurrentDb()
#objDB.Run('doNothing')
objAccess.Application.Quit()