This is an example of a call from C # to an access database function that I used in the past to create a similar function.
private void btnRunVBAFunction_Click(object sender, System.EventArgs e)
{
Access.Application acApp = new Access.ApplicationClass();
application
acApp.OpenCurrentDatabase(@"C:\temp\db1.mdb",false ,null);
object oMissing = System.Reflection.Missing.Value;
acApp.Run("Test",ref oMissing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing
,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing
,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing
,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing
,ref oMissing,ref oMissing);
acApp.Quit();
}
This is the site that I have used in the past.
http://bytes.com/topic/c-sharp/answers/255310-run-microsoft-access-module-vs-net-c
source
share