Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import System
  2. t = System.Type.GetTypeFromProgID("Access.Application")
  3. access = System.Activator.CreateInstance(t)
  4. access.OpenCurrentDatabase(r'C:\Users\Public\Database1.accdb')
  5.  
  6. # A VBA Module in the opened database contains:
  7. #
  8. # Public Function AddTenFunction(in_value As Long) As Long
  9. #     AddTenFunction = in_value + 10
  10. # End Function
  11. #
  12. fn_result = access.Run("AddTenFunction", 4)
  13.  
  14. access.Quit()
  15. print(fn_result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement