B
brettn
I am attempting to create an add-in for MSAccess with C#
Using the VS2005 shared add-in template, I cast the application object to
Microsoft.Office.Interop.Access.Application and use the CurrentProject
property to get the name of the currently open Access Project. All works fine
until I close MSAccess - it disappears but is not unloaded (still in task
list), and subsequent attempts to run MSAccess fail until the previous
process instance is cancelled.
// cast application object
applicationObject = (Access.Application)application;
// from add-in action (say button.onClick)
string str = applicationObject.CurrentProject.ToString();
if I don't use any of the 'project' or 'data' properties of the
applicationObject, MSaccess closes ok (adding command bars etc works fine),
but even though references to CurrentProject work ok (return correct values),
using them stops MSAccess from unloading.
I've seen other posts to newsgoups about this behaviour, but no resolution.
Any help appreciated.
Using the VS2005 shared add-in template, I cast the application object to
Microsoft.Office.Interop.Access.Application and use the CurrentProject
property to get the name of the currently open Access Project. All works fine
until I close MSAccess - it disappears but is not unloaded (still in task
list), and subsequent attempts to run MSAccess fail until the previous
process instance is cancelled.
// cast application object
applicationObject = (Access.Application)application;
// from add-in action (say button.onClick)
string str = applicationObject.CurrentProject.ToString();
if I don't use any of the 'project' or 'data' properties of the
applicationObject, MSaccess closes ok (adding command bars etc works fine),
but even though references to CurrentProject work ok (return correct values),
using them stops MSAccess from unloading.
I've seen other posts to newsgoups about this behaviour, but no resolution.
Any help appreciated.