Advertisement
Guest User

Untitled

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