Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. var app = new Microsoft.Office.Interop.Access.Application();
  2. app.OpenCurrentDatabase(@"C:\Users\Public\Database1.accdb");
  3.  
  4. // A VBA Module in the opened database contains:
  5. //
  6. // Public Function AddTenFunction(in_value As Long) As Long
  7. //     AddTenFunction = in_value + 10
  8. // End Function
  9. //
  10. int fnResult = app.Run("AddTenFunction", 4);
  11.  
  12. app.Quit();
  13. Console.WriteLine(fnResult);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement