via COM, procedure runs, but macro output doesn't show up.

S

Stan Graziano

I've got a macro, JanMacro, which is called from a procedure JanMacroRunner.
If I execute the procedure from inside Access, the macro correctly exports a
query to a .dbf file. However, if I call the procedure via COM as shown
below, the COM object succeeds (it doesn't throw an exception like it would
if I used a non-existant procedure name), but there is no .dbf file written
to the filesystem. What's going on, and how can I diagnose this?

Thanks in advance. Here is the c# asp.net serverside code I'm using to call
the procedure:

....
Access.ApplicationClass oAccess = new Access.ApplicationClass();
oAccess.Visible = true;
oAccess.OpenCurrentDatabase(path, false, "");

// Run the macros.
RunMacro(oAccess, new Object[]{"JanMacroRunner"});
......

private void RunMacro(object oApp, object[] oRunArgs)
{
oApp.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod,
null, oApp, oRunArgs);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top