Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import System
- t = System.Type.GetTypeFromProgID("Access.Application")
- access = System.Activator.CreateInstance(t)
- access.OpenCurrentDatabase(r'C:\Users\Public\Database1.accdb')
- # A VBA Module in the opened database contains:
- #
- # Public Function AddTenFunction(in_value As Long) As Long
- # AddTenFunction = in_value + 10
- # End Function
- #
- fn_result = access.Run("AddTenFunction", 4)
- access.Quit()
- print(fn_result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement